Mac Tip of the Day (MTotD)
Have you ever had the need to copy (and paste) the file name contents of a folder in the Finder? Similarly, have you ever had the need to copy/paste a folder structure hierarchy (directory path)?
This is one of those annoying tasks that comes up once in a while. I say annoying, because that’s exactly what it is – annoying! Why? Because, it should be something relatively straightforward to accomplish. And in the old days – say, pre- OSX, it was. If you selected a file in the Finder and hit “copy”, it loaded the file name to the clipboard for pasting purposes.
However, at some point, Apple decided that people really wanted to copy files, not names. This is the standard behavior on a Windows PC (as far as I know – correct me if I’m wrong.)
So in OSX, when you select a file (or more) in the Finder, and choose “copy”, it will literally copy those files to the place where you designate, upon which “pasting” will copy the files to the specified location.
In many cases, this is desirable. You no longer need to have the source folder and destination folders open and side by side on your desktop. Especially if you tend to have a cluttered desktop! So, yes, this can be seen as an “improvement”.
But what about the old functionality? Where you could extract the filenames themselves and use the text for other purposes – ie: printing directories, etc. Well, nothing that I knew of allowed you to do this as easily as in those old days.
Until now I just haven’t looked it up to crack this nut. It just wasn’t super critical, even though I knew some day I’d need to get around to solving this puzzle. With Apple, you just know that there is a way to do things, even if it requires a workaround, or isn’t fully documented.
In many cases, Google (and Bing, and/or Yahoo, etc.) can be your best friend, when you just can’t figure it out by yourself. Sure enough, I did find the answer posted. And yes, this can be done.
No, not as simple as it used to be, but the hoops aren’t difficult to jump through either. All you need is to open a blank document in Apple’s TextEdit. Make sure you convert it to plain text, not Rich Text (COMMAND+SHIFT+T).
Actually, there are two tricks in one, depending on the text you need to extract.
If you want just the file names in an orderly list, select the files you need in the Finder and COPY. Go into your TextEdit document and PASTE. Your filenames will now appear. This even gives you folder names as well, if you’ve selected them. Note: if you want to have the names of the files within subfolders, make sure the containing folders are open so you can select those interior files as well. As long as your files are visible and selected, it will grab their names.
The other part of the trick is if you want to extract, not only the file names, but the directory paths as well. In this case, do your selection as before, but instead of copying/pasting, simply drag the files to the TextEdit document window. It will produce a nice and tidy list of the directory paths for each file.
Nice!