Listing files in a folder

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
sclg
Posts: 29
Joined: 23 Sep 2009 15:47
Location: UK

Listing files in a folder

Post 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

serendipity
Posts: 3358
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: Listing files in a folder

Post 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!

sclg
Posts: 29
Joined: 23 Sep 2009 15:47
Location: UK

Re: Listing files in a folder

Post 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

serendipity
Posts: 3358
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: Listing files in a folder

Post 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>);

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Listing files in a folder

Post 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.

Stefan
Posts: 1360
Joined: 18 Nov 2008 21:47
Location: Europe

Re: Listing files in a folder

Post 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.

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Listing files in a folder

Post 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.

serendipity
Posts: 3358
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: Listing files in a folder

Post 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.

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Listing files in a folder

Post 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. :)

serendipity
Posts: 3358
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: Listing files in a folder

Post 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>);

sclg
Posts: 29
Joined: 23 Sep 2009 15:47
Location: UK

Re: Listing files in a folder

Post by sclg »

Thanks all - yes, plain text is fine :)
Steve

Obviously time for me to go and investigate scripting in a bit more depth!

Post Reply