Page 1 of 1
Simple Filename Save to Clipboard
Posted: 29 Jan 2019 20:15
by JohnL
Hi, I'm new to XYplorer (and loving it; wish I'd discovered it years earlier).
I can't find a particular capability that I'm looking for. I want to create a list of filenames, plus subfolders and their files, but that's all I want, i.e.:
Folder name
Filenames
Subfolder name1
Filenames
Subfolder name2
Filenames
etc.
I've tried out the "File > To Clipboard" and "Info Panel -> Report tab" features, but they all deliver too much information, e.g. file size, date, etc. I can't figure out how to pare down to just the simple list of file names. I can always post-process the listing elsewhere, but I'm trying to avoid the extra steps. Am I missing something?
Thanks!
John
Re: Simple Filename Save to Clipboard
Posted: 29 Jan 2019 20:22
by highend
Everything without paths?
You could switch on the branch view mode, select all (ctrl+a) and then ctrl+shift+p (which is normally bound
to To Clipboard - Item Name(s))...
Re: Simple Filename Save to Clipboard
Posted: 30 Jan 2019 04:20
by JohnL
Thanks for that suggestion, highend. Your method does in fact copy simple filenames (no paths, no other attributes). However, it only copies the current folder--no subfolders.
John
Re: Simple Filename Save to Clipboard
Posted: 30 Jan 2019 06:14
by bdeshi
highend wrote: ↑
You could switch on the branch view mode,
I think you missed this step.
First enable Branch View from Menu > View > Views > Branch View. or hit ctrl+shift+b. or press the branch view button on the toolbar.
Then do ctrl+a, and ctrl+shift+p.
Re: Simple Filename Save to Clipboard
Posted: 31 Jan 2019 05:28
by JohnL
Sammay, I actually misinterpreted that step. I clicked the checkbox: Info->Report->Current Folder->Tree structure. Doh!
But your clarification got me on the right track. The technique captures all filenames, and filenames only. It ain't pretty. That is, the folder names are listed in sequence with the filenames without being set off in any way, but I can live with that.
Thanks for the help!
John
Re: Simple Filename Save to Clipboard
Posted: 31 Jan 2019 05:46
by jupe
If it is of any interest to you below is another way to do it via a script instead of the gui, doing it this way you could customize it to indent the files or add a divider to the folders etc.
If you wanted to try it just goto the root path you want the list created for, and then run it from the XY addressbar (no need to be in branch view mode)
Code: Select all
text report("{dir {Name}| {Name}}<crlf>", quicksearch(,,"|"));
to learn the possibilities of the report scripting command look it up in the help file under the Advanced Topics\Scripting Commands section.
Re: Simple Filename Save to Clipboard
Posted: 01 Feb 2019 06:08
by JohnL
Very nice, jupe! Even better than the gui approach. I added it to a script item in the Catalog, with these mods:
text report("{dir ==== {Fullname} ====|{Name}}<crlf>", quicksearch(,,"|"));
This sets off the folder with the equal signs before and after a full path/name. Is there a better way of repeating the equal signs?
Re: Simple Filename Save to Clipboard
Posted: 01 Feb 2019 06:23
by jupe
Regarding the equal signs, the way you have done it looks ok, but you could also post process the output to count each line to find the longest line, then add as many equal signs to each line as needed to keep each line to a certain length (justified) if that is what you were asking?, the possibilities are pretty endless with scripting, you could even generate html tables etc, all script commands are pretty extensively documented in the help file.
PS: FYI, if you want the output to go straight to clipboard without the text popup, just replace the "text" prefix with "copytext".
Re: Simple Filename Save to Clipboard
Posted: 01 Feb 2019 22:56
by JohnL
Thanks for the tip on copytext.
I don't need anything as pretty as even-length lines. I think I'll work out an if-then-else that sets off folder names with, say, lines before and after, but just lists filenames in a plain list.
Re: Simple Filename Save to Clipboard
Posted: 02 Feb 2019 01:04
by jupe
I wasn't sure what you were asking, so in that case then this is probably close to what you are after:
Code: Select all
$div = strrepeat("=", 60); text report("{dir $div<crlf> {Fullname} <crlf>$div|{Name}}<crlf>", "<curpath>|" . quicksearch(,,"|"));
Re: Simple Filename Save to Clipboard
Posted: 03 Feb 2019 03:36
by JohnL
jupe, that's perfect! Exactly what I was looking for. Thanks very much.--John