Page 1 of 1
Listing files in a folder
Posted: 03 Oct 2009 19:15
by sclg
Is there any way to copy a list of files in a folder to the clipboard so I can, for instance, paste it into Word or whatever?
i.e. I need a command that copies the list of content of the selected folder.
Thanks
Steve
Re: Listing files in a folder
Posted: 03 Oct 2009 19:18
by serendipity
Yes, you can select files and press "control+p" to copy all file with paths or control+shift+p to copy filenames alone. Later you can paste this in any other place.
by the way, you can automate the copy, pasting writing to text file by using a simple script. let me know if you need one.
happy XYploring!
Re: Listing files in a folder
Posted: 03 Oct 2009 19:26
by sclg
Thanks - that's an excellent start.
It would be nice if I could just select a folder in the tree pane and do something to get a list of all the files.
i.e. without having to highlight the files first.
(I know it's trivial - I'm just idle

)
Steve
Re: Listing files in a folder
Posted: 03 Oct 2009 19:38
by serendipity
sclg wrote:Thanks - that's an excellent start.
It would be nice if I could just select a folder in the tree pane and do something to get a list of all the files.
i.e. without having to highlight the files first.
(I know it's trivial - I'm just idle

)
Steve
try this from menu "Scripting|Try Script":
Code: Select all
/*Write file paths to .doc file*/
focus; //focus on list
sel a; // select all files
#101; // copy file paths to clipboard
writefile ("<curpath>\ListOfFiles_<date yymmdd_hhnnss>.doc", <clipboard>);
Re: Listing files in a folder
Posted: 03 Oct 2009 20:05
by admin
serendipity wrote:sclg wrote:Thanks - that's an excellent start.
It would be nice if I could just select a folder in the tree pane and do something to get a list of all the files.
i.e. without having to highlight the files first.
(I know it's trivial - I'm just idle

)
Steve
try this from menu "Scripting|Try Script":
Code: Select all
/*Write file paths to .doc file*/
focus; //focus on list
sel a; // select all files
#101; // copy file paths to clipboard
writefile ("<curpath>\ListOfFiles_<date yymmdd_hhnnss>.doc", <clipboard>);
Why DOC? My Word does scream for a converter when I feed it a text file called DOC.
Re: Listing files in a folder
Posted: 03 Oct 2009 20:09
by Stefan
admin wrote:
Why DOC? My Word does scream for a converter when I feed it a text file called DOC.
Because the OP asked for .doc in first place.
Re: Listing files in a folder
Posted: 03 Oct 2009 20:11
by admin
Stefan wrote:admin wrote:
Why DOC? My Word does scream for a converter when I feed it a text file called DOC.
Because the OP asked for .doc in first place.
Ah, ok. But that does not make it work better.
Re: Listing files in a folder
Posted: 03 Oct 2009 20:12
by serendipity
admin wrote:serendipity wrote:sclg wrote:Thanks - that's an excellent start.
It would be nice if I could just select a folder in the tree pane and do something to get a list of all the files.
i.e. without having to highlight the files first.
(I know it's trivial - I'm just idle

)
Steve
try this from menu "Scripting|Try Script":
Code: Select all
/*Write file paths to .doc file*/
focus; //focus on list
sel a; // select all files
#101; // copy file paths to clipboard
writefile ("<curpath>\ListOfFiles_<date yymmdd_hhnnss>.doc", <clipboard>);
Why DOC? My Word does scream for a converter when I feed it a text file called DOC.
Really!! it works straight away here (WinXP laptop, Office-2007). hmm i will change to text then.
Re: Listing files in a folder
Posted: 03 Oct 2009 20:15
by admin
serendipity wrote:admin wrote:serendipity wrote:sclg wrote:Thanks - that's an excellent start.
It would be nice if I could just select a folder in the tree pane and do something to get a list of all the files.
i.e. without having to highlight the files first.
(I know it's trivial - I'm just idle

)
Steve
try this from menu "Scripting|Try Script":
Code: Select all
/*Write file paths to .doc file*/
focus; //focus on list
sel a; // select all files
#101; // copy file paths to clipboard
writefile ("<curpath>\ListOfFiles_<date yymmdd_hhnnss>.doc", <clipboard>);
Why DOC? My Word does scream for a converter when I feed it a text file called DOC.
Really!! it works straight away here (WinXP laptop, Office-2007). hmm i will change to text then.
I have only Word 2002. Don't bother. If it works for you it's ok. Word is my personal enemy so I would not be surprised if it just does not work for me.

Re: Listing files in a folder
Posted: 03 Oct 2009 20:27
by serendipity
@Don: But i see your point. maybe its best to post scripts that work for all, so i guess text is best
@sclg:
Because of inconsistencies with word with different versions and OS, i am posting a different script which pastes list of files to text file.
If you dont want the writing to text part, you can delete the last line "writefile ..." which will skip the writing. Files will be available on clipboard, so after you run this script, you can directly paste it into your word file.
Code: Select all
/*Write file paths to .text file*/
focus; //focus on list
sel a; // select all files
#101; // copy file paths to clipboard
writefile ("<curpath>\ListOfFiles_<date yymmdd_hhnnss>.txt", <clipboard>);
Re: Listing files in a folder
Posted: 03 Oct 2009 20:31
by sclg
Thanks all - yes, plain text is fine
Steve
Obviously time for me to go and investigate scripting in a bit more depth!