Mac OS X: Print or Save a List of File Names

| TMO Quick Tip

There are a couple of good ways to print or save a list of a folder’s contents, depending on what result you’re looking for. We’re going to be using the TextEdit program for this, which is a nifty little word processor that comes by default on your Mac. It’s in your Applications folder.

So open that and get a new document started. You’ll want to make sure that you’re using a plain-text document and not a rich-text one, which you can toggle under the Format menu or by hitting Shift-Command-T.

The first way to start your list is to select the files you want in it and drag them into that TextEdit document.

If you’ve ignored my rich-text/plain-text advice above, you may get a bunch of pasted graphics (or what have you). Never ignore my advice, you silly thing.

If you see the formatting toolbar pointed out above, your TextEdit document is set to rich text.

 

If, however, you’ve done as I suggested, you’ll get a neatly formatted list of files, complete with the folder path that contains each of them.

What if you don’t like the paths, though? What if a file path traumatized you when you were a child? It’s lucky that there’s an easy way around that, then. Select the files again, and instead of dragging them, hit Command-C (or choose Edit > Copy), then go back to your TextEdit document and hit Command-V (or choose Edit > Paste). Holy crap, it’s a list of just the file names without the paths.

Easy, huh? Now you can print a list of your files without having to resort to third-party programs, screenshots, Terminal, or Automator. Or banging your head against a wall, either. That rarely does anyone any good.

Sign Up for the Newsletter

Join the TMO Express Daily Newsletter to get the latest Mac headlines in your e-mail every weekday.

Comments

Warlock

Melissa, you are crazy, but you always provide at least a good chuckle or a good laugh.  Keep it up, us old geeks enjoy it & also learn a lot from your column.

Dr.MORO

WOW! Lovely trick! Great to know!

Nice job, as always, Melissa!

NOW, a question for you.

Since talking about file names WITH ‘paths’, how can one copy this ‘path’, and paste it as text somewhere else, other than using your TextEdit method? I’m asking for a simpler & more direct method, if any.

~ Dr.MORO

PeaceFreak

This is an excellent tip. Check out Print Window if you need more options:

http://www.macupdate.com/app/mac/6465/print-window

Scott B in DC

1. Start Terminal
2. ‘cd Documents/Backgrounds’ (or where ever you want to list the directory)
3. ‘lpstat -a’ gives the name of configured printers.
4. enter the following command:

ls lp -'name_of_printer_from_lpstat_output' 

Quicker and easier!

Melissa Holt

Hey Warlock,

Thanks for the kind words! I like being crazy?it helps me keep my sanity.

?Melissa

Melissa Holt

Hey Dr.MORO,

“Easy” is in the eye (mind?) of the beholder in this case, I guess, as I wanted to give users a pretty simple thing to remember. As PeaceFreak and Scott B in DC have so wisely demonstrated, you can accomplish the same task using third-party utilities or the Terminal, and if that’s your cup of tea, more power to ya. There is (to me) a more direct method, but it requires using Automator. Maybe you’ll like this way better.

Anyway, here’s how you do it:

Open Automator (it’s in your Applications folder). When it asks you what type of file you’d like to create, choose Application. Then drag two actions into the workflow window:

1. Files & Folders > Get Selected Finder Items
2. Utilities > Copy to Clipboard

Save it out somewhere convenient (like your Desktop). Then, any Finder items you drop on that application (or on its Dock icon, if you place a shortcut there) will have their full paths copied to your clipboard, ready to be pasted wherever you want.

The great thing about this is that once you’ve created your sweet little application, you don’t have to worry with TextEdit or Terminal from then on.

Hope that helps!
Melissa

Paul Goodwin

Great tip, and a fun article. When I was a child (say age 10 in 1958), the only paths we knew about were in the woods. Oddly, I’m guessing that the path names on computers back then probably looked exactly like they do now.

Melissa Holt

Thanks, Paul! And when I was 10, I didn’t know anything about computer paths, either . . . because my silly parents refused to buy me a TRS-80! I still haven’t forgiven them.

Niall

Thank you. Great tricks and I like your sense of humour.
Niall, Dublin, Ireland.

Melissa Holt

Thanks, Niall! I appreciate you reading my stuff very much.

—Melissa

Elbio

Excellent advice!  You made my day!

Melissa Holt

Aw, I’m glad, Elbio! :D

Log-in to comment