Putting the full path in your Finder window titles
Today Tim asked me how I got the full path to show up in my Finder window titles.
“It’s just a couple of commands you run in the Terminal,” I told him.
“ooooh, those always scare me,” he replied.
I continued, “They should. You can really mess things up if you stray very far from the exact keystrokes required.”
And that was that.
Later tonight I went looking to see if I could find the Terminal commands that I had used to change the default behavior on my Macs. I found them and am posting them here for posterity (and so I can find them easier next time :p)
defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES
killall Finder
Keep in mind that in the Terminal capitalization is important. So it’s best to cut and paste those two lines (one at a time).
To turn the path thing off, just repeat the two commands except change the all-caps YES to an all-caps NO.
I realized that if Tim gets it, then all of the extended Mac OS X family is going to want it. And it’s really not a good idea for them to be playing with their Terminal. That’d be a whole bag of hurt I just don’t want to deal with.
So I AppleScript-ized the shell commands by firing up the old AppleScript Editor and wrapping the two commands with “Do Shell Script” statements and an “On Run” block.
Here’s what the whole AppleScript looks like. You can copy and paste these lines into your own AppleScript Editor:
on run
do shell script "defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES"
do shell script "killall Finder"
end run
Alternatively, you could just download the handy-dandy .zip file that I’ve included here and run the AppleScript Apps. They’ll do the dirty work for you. Note that when you run them, it is normal for the Finder to stop running for a second. You’ll see your windows and desktop icons go away for a second, but they’ll come right back and all will be well with the world.
The .zip file includes two AppleScript Apps. One for putting the path in the title bar, and one for removing it.
Simple.
BTW, I do know that these Terminal commands work in Mac OS X 10.5 and 10.6, but I’m not 100% certain that the AppleScripts posted here will run in 10.5 since I compiled them on a 10.6 machine. If you have any trouble with the AppleScripts you can resort to the cut and paste method of the code above. If you have any questions, let me know in the comments and I can help you work it out.


