Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I want to make a .txt file inside the same folder that contains all the filenames of said folder.

How can i do that?

Thanks.

share|improve this question
What have you tried? – David Cain Mar 15 at 23:27

2 Answers

up vote 0 down vote accepted

Or you can create an Automator Workflow like this as a Service, so that all you have to do is right click the folder, click the service and this text file will appear in the folder, with the name of the folder.

Get Contents of Folder as Text Service Workflow

share|improve this answer
That´s what i wanna do, but instead of a .txt file with the name of the folder i want that file to contain all the filenames of the files inside this folder. – dusanvf Mar 19 at 14:42
Ok great. That's what the above does. It's puts the names of the folder contents in a text file and in that folder. – Philippe Dube Mar 20 at 16:46
Did it work for you now? – Philippe Dube Mar 21 at 21:46
Yeah it works, but is there a way to create the "Get Names of Finder Items" action instead of using the one from Automated Workflows?, because it keeps asking me to register and it only lists 5 items. – dusanvf Mar 26 at 14:00
No. You will have to use applescripting for that. The Get Names of Finder Items and the other 30 actions that come with that is well worth it as I use them all the time and it solved many workflows that I was trying to create. – Philippe Dube Mar 27 at 19:55
show 2 more comments

you can do this in terminal by using

ls {DIR} >> {FILE}

for example if i wanted to write a file called 'ls.txt' of all the files on the desktop i could use

ls /Users/corvinmcpherson/Desktop/ >> /Users/corvinmcpherson/Desktop/ls.txt

you can also create one using automator like this: enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.