Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Building a TextEdit list from the names of files in a folder

How can I make a TextEdit list that has all the names of the files in a folder?

example:
lets say I have three files in a folder:
1.jpg
2.jpg
3.jpg

I want to build a TextEdit file that list these three items, so I would have:
1.jpg
2.jpg
3.jpg
in text, not the actual files in the TextEdit file, but just the names.

Thanks.

Dual G5 2.0, Mac OS X (10.4.4)

Posted on Jan 25, 2006 4:32 PM

Reply
4 replies

Jan 25, 2006 8:45 PM in response to calicoradio.com

Open the Script Editor in the /Applications/AppleScript/ folder, and paste in the following

set delimiters to AppleScript's text item delimiters
set AppleScript's text item delimiters to {return}
try
tell application "Finder"
set the_names to name of every file of folder "myfolder" --insert the path to the folder here, delimited by colons
end tell
tell application "TextEdit"
set text of (make new document) to (the_names as string)
end tell
end try
set AppleScript's text item delimiters to delimiters

Press the Run button.

(10271)

Jan 26, 2006 12:25 AM in response to Niel

Well yes, that works. 😉

If you want an alphanumeric list of everything in the folder, open it, select view as Columns, click the first, hold the Shift key and click the last, hit the Command-C combo, switch to TextEdit and paste.

If you wanted only files and not folders you would think you could open list view, arrange by kind and you would be in business. Unfortunately that doesn't actually work. Alphanumeric order is not preserved in the copy, no one seems to know why.

User uploaded file
Francine
Schwieder

Building a TextEdit list from the names of files in a folder

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