Can't copy & paste list of FILE NAMES only

Is there a key combination to use with CMND-C that will tell the OS to only copy the file names selected in a finder window?

I need to be able to select file names in a finder window, usually column view, and then copy and paste them into email. I use this to inform clients of project progress. Before Tiger I could do this. Now when I select the file name/names and paste into Apple Mail, the OS tries to paste all of Files themseleves, not just the names. Since these are image files, Mail usually quits after trying to handle a few gigabytes of data.

My work around is to Select the file names in the list, and Copy. Then I open Text Edit, make the document a Plain Text document, and then Paste the file names into Text Edit. I then select the file names in Text Edit, Copy, and Paste into my email document. Since I have to do this several times a day, it is a royal pain, and I often forget to do it because for years it was routine to copy and paste file names.

Is there a key combination to use with CMND-C that will tell the OS to only copy the file names?

Thanks,
Craig

several, Mac OS X (10.4.1)

Posted on Jul 9, 2008 7:25 PM

Reply
8 replies

Jul 10, 2008 12:03 AM in response to BDAqua

Thanks for your reply but as I wrote in my original post, I AM going through text edit, just as you describe.
Since I started working on the Mac in 1991 this was not necessary, until Tiger that is.
Since I and my coworkers have to perform this routine several times a day, our studio upgrade to Tiger has meant an additional headache and a loss of productivity.

Is there NO key command that will provide the functionality to just copy the file names?

Craig Cheatham

Jul 10, 2008 1:46 PM in response to Craig Cheatham

Craig,

You might consider using one of the scripts found on this macscripter.net thread. As the thread is old and may not render well in your browser, I've reproduced the scripts below.Thanks to Rob and Jonn8 respectively.

+Rob's Script:+

*set output_ to (choose file name with prompt "Choose a name and location for the new file.")*
*set folder_ to (choose folder with prompt "Select the folder containing the files whose names should be collected.")*
*tell application "Finder" to set files_ to files of folder_ as alias list*
*set names_ to ""*
*repeat with file_ in files_*
*set names_ to names_ & ((name of (info for file_) & return))*
*end repeat*
try
*set file_ref to open for access output_ with write permission*
*write names_ to file_ref starting at eof*
try
*close access file_ref*
*end try*
*on error e*
*display dialog e*
try
*close access file_ref*
*end try*
*end try*

+Jonn8's Script:+

*set folder_list to list folder of (choose folder with prompt "Select a folder:") without invisibles*
*tell (a reference to my text item delimiters)*
*set {old_delim, contents} to {contents, return}*
*set {folder_list, contents} to {"" & folder_list, old_delim}*
*end tell*
*do shell script "echo " & (quoted form of folder_list) & " > " & (quoted form of POSIX path of (choose file name with prompt "Save the file name list as:" default name "files.txt"))*

With either script, copy the block of code in bold and paste it into your AppleScript Script Editor. Choose File > Save As > File Format: script, to be run from the Scripts Menu; or File > Save As > File Format: application, to be run from the Dock, or wherever.

Either script will present you with a choose folder dialog as well as an opportunity to name a new text file. This new text file will contain the names of the items within the chosen folder, either file names only (Rob's script), or both file and folder names (Jonn8's script).

From there it's a matter of copy-and-pasting the list of names to a new mail message, or simply attaching the text file to the new mail message.

Just an idea for you... Good luck!

Regards, Andrew99

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Can't copy & paste list of FILE NAMES only

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.