19 June 2007

FTFF: an up button for the Finder

I've been looking around at what the FTFF (Fix The Fucking Finder) blogs have been griping about, to see what they have to say about the 10.5 preview. My biggest complaint with the 10.4 Finder is the fact that search folders are second-class citizens, and the "integrated search" that Apple (and Microsoft and Be) have promised us never materialized. It looks like they fixed that in 10.5. We'll see.

But that's not what everyone else seems to care about. In fact, the top three complaints are:
  1. no "spacial Finder"/settings memory,
  2. beachballs for unpreviewable files/lost network connections, and
  3. no "up" button on the toolbar.
I don't have a solution for the first two (and #2 bothers me), but #3 is easy.

Personally, I don't have much problem hitting cmd+up arrow, or holding cmd and clicking on the window title to move upward. However, apparently plenty of people do. So, here's the answer:

Fire up Script Editor (in Applications/AppleScript) and paste the following:
tell app "Finder" to set target of front window to parent of target of front window

Now save it to your home directory as an application without splash screen called, say, Finder Up. Go back to the Finder and drag "Finder Up" into the toolbar. You may have to hold it still for a second, but then it'll appear as a toolbar button, and you can drop it. Now, whenever you want to go up to the parent folder, click that button. Tada!

You may notice that the icon in your toolbar is the generic AppleScript application icon, which isn't too helpful. If you want to fix this, find a .icsn file that you like (maybe the Sort Ascending.icns buried somewhere in System--Spotlight'll find it for you), preview it, copy it, get info on Finder Up, click the icon, paste, and now you have a new icon. (You can also copy a .png, .tiff, or other image file, as long as it has transparency.)

Finally, you may notice that it takes a fraction of a second for the up arrow to do its thing, and you get the slightly annoying effects of an app launching and quitting whenever you click it. You can solve this by saving the script as a stay-open application and rewriting it as follows:
on run
tell application "Finder"
set target of front window to parent of target of front window
activate
end tell
end run

on reopen
run
end reopen

While you're at it, you can save it as an application bundle instead of an application, click the "Bundle Contents" button, and replace the applet.icns with the .icns file you found somewhere else.

Yeah, it's a bit more complicated, but it works.

It still doesn't grey out when you're already at the parent directory and can't go up any farther, and so on. It wouldn't be too hard to write a real application that does all of this right, but this ought to be good enough.