How to extract filenames from a folder

I’m doing a lot of client document reviews. In the final report, I need to refer to all reviewed/submitted documents.

I’m now copying each filename from finder and paste it in my report. This is a lot of work (and boring).

Is anybody aware of a way to automate the process?

Rob.

Open the folder in Terminal and type

ls -1 | pbcopy

This will get a plain text list of all the files and subfolders in that folder and copy it to the clipboard.

6 Likes

Thanks. That helps in the right direction!

There’s an app or that… File List Export, works very well.

2 Likes

As mentionend, with ls you can list files in the shell. If you are writing in Word, just mark the files in Finder, copy to clipboard and use “Insert as->Text”.

Why pay $5 if you can do it for free with ls?

2 Likes

I know that’s a rhetorical question, but I can’t help myself.

Because it’s in ever shrinking percentage of users who know about the terminal at all and then probably a smaller set who reach for it first.

The default has been increasingly to just reach for an app as it’s more “friendly”

I would recommend the terminal here, but if it was my grandma, maybe the app might be worth it?

To do what File List Export can do with metadata , you’d need to pipe your ls output to mdls (after looking up the relevant metadata keys), then to sed or something else to clean it up & convert it to csv. Totally doable but not worth Interrupting the real work I’m doing in order to muck about in bash unnecessarily. I’d rather pay $5 and not need to worry about it.

1 Like

There’s also this:

https://www.macobserver.com/tmo/article/mac_os_x_print_or_save_a_list_of_file_names

Would also echo this sentiment. Just because something could be done in the terminal doesn’t mean it’s the most efficient way to do something. If this $5 app solves a particular problem someone has and saves them otherwise headache and frustration, then it’s worth it to them.

1 Like

Check that link I posted. You can select folder contents and drag-n-drop onto an empty TextEdit doc and get a list pretty easily.