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\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:

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>
	<function type="normal">
		<instruction>@nofilenamequoting </instruction>
		<instruction>Print FOLDER TO=&quot;D:\Vic3D\Past\Meeting Show Lists\{sourcepath|nopath|noterm}.txt&quot;</instruction>

You might like further automation, have a look here:!Documents/Print.htm

How to do all this:


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

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