File naming when printing folder contents

I regularly use "Print/Export Folder Listing ..." (Tools menu).
I always export the listing to a text file; it would be great if the text file name could be generated from the name of the source folder. The destination folder for the text file will always be the same; I just want to generate the file name.

For example, I want to print folder listing for
D:\Vic3D\Meetings\2021_03_March
as
D:\Vic3D\Past\Meeting Show Lists\2021_03_March.txt.

Using {Sourcepath}.txt in the filename entry box didn't do what I need, and I'm out of ideas.

You need to modify the button (or create a new one). The current looks like this:

Print FOLDER    

To enter the name change it to this:

@nofilenamequoting 
Print FOLDER TO="D:\Vic3D\Past\Meeting Show Lists\{sourcepath|nopath|noterm}.txt"
Button as XML
<?xml version="1.0"?>
<button backcol="none" display="both" label_pos="right" textcol="none">
	<label>Print Folder</label>
	<icon1>#printfolder</icon1>
	<function type="normal">
		<instruction>@nofilenamequoting </instruction>
		<instruction>Print FOLDER TO=&quot;D:\Vic3D\Past\Meeting Show Lists\{sourcepath|nopath|noterm}.txt&quot;</instruction>
	</function>
</button>

You might like further automation, have a look here:

https://www.gpsoft.com.au/help/opus12/index.html#!Documents/Print.htm

How to do all this:

2 Likes

Perfect.
MANY thanks!

And I will certainly study the additional material you've linked; I add many items to menus and toolbars. I particularly like the "3-button" as a compact group of related commands.

Many thanks, lxp

@nofilenamequoting 
Print FOLDER FORMAT PrintList FLATVIEW Grouped QUIET TO="D:\Vic3D\Stand-by Shows\_Past\z_Meeting Show Lists\{sourcepath|nopath|noterm}.txt"

does exactly what's needed.

1 Like