Page 1 of 1

Report - for directory

Posted: 16 Dec 2022 08:53
by Julian
The Report tab in the info panel creates a list of file for the current directory.

It would also be good to be able to add prefix and suffix text to each line, for example if I just need a lit fo files with start and end delimiters, i.e. to be used in a BAT file or a programming language.

I know that I can could create a custom column which includes this text, but a) that is not so easy to do ab b) the text cannot be changed quickly.

Re: Report - for directory

Posted: 16 Dec 2022 17:37
by jupe
Well you can create custom reports with a simple scripting command, lookup report() in the Advanced Topics Scripting Commands Reference.

Re: Report - for directory

Posted: 17 Dec 2022 09:59
by Julian
Thank You, that is a good tip.

I created a script and put it in the catalog. It is supposed to create a BAT file to use robocopy to copy the selected directories to a different drive.
I just wonder how to enable a "Save as" button on the dialog displayed by text() - or is there a different dialog available? I do not really want to save directly to a file.

This is my script:

Code: Select all

::$dest = input("Create robocopy script","Enter destination drive/dir", "Z:\", e, "" ); text report( "robocopy /E ""{name}"" ""$dest{name}"" <crlf>" , 1, "echo Start robocopy to copy to $dest?<crlf>Pause<crlf><crlf><crlf>", "pause<crlf>" ), "Robocopy Batch commands";    

Re: Report - for directory

Posted: 17 Dec 2022 10:20
by highend
There is no save as... button for text

Use e.g. confirm after displaying the text and ask if you want to save that file.
If true, use outputfile & writefile...