After reinstalling some development software the other day I needed to access some XML files that were in a hidden directory. Typically I would filter all my access to hidden files through the appropriate Terminal commands but I decided to look for a more elegant solution. Immediately, I found the following Terminal command that directs Apple Finder to show all hidden files:
defaults write com.apple.finder.AppleShowAllFiles ON
That's at least a start, but I don't want to fire up Terminal to run two simple commands, one to turn on hidden file viewing and one to turn it off - plus, restarting Finder altogether. After digging around a bit I found an AppleScript that automates the process. I made a few adjustments to suit my needs and I was in business. Seeing how useful my MusicStoreAutoPlay script was I decided to offer this one up as well.
Here are some installation instructions:
- Download the zip, and extract the AppleScript file to the /Users/your-user-name/Library/Scripts folder. If this folder doesn't exist, create it.
- The Finder does not have a "script" menu like iTunes does so I recommend turning on the system-wide "Script Menu." Navigate to /Applications/AppleScript/ and double-click the "Install Script Menu" Application. This will create a new "script" menu that shows in the menu bar (upper right near the clock). You can use this script menu drop-down to access the ToggleHiddenFiles AppleScript.
- Here's a link with more info on the system-wide Script Menu.

About this post:
This entry was posted by Aaron West on March 10, 2006 at 10:04 AM. It was filed in the following categories: Programming, Mac. It has been viewed 11450 times and has 6 comments.
Thanks, this is just what i needed as an ex-ubuntu user :)
FYI, this didn't work on my macbook-tiger, so I opened it in script editor and changed instances of "ON" to "TRUE" and instances of "OFF" to "FALSE". Works fine now. Thanks.
That's interesting Mike. I've heard a few users mention my script not working on Leopard but you are the first to have any problems with Tiger. I don't have a Tiger machine to do any more testing otherwise I'd look into this. Thanks for for commenting.
Hi,
I just tried this as well and it gives me an error. I'm using leopard. The error it gives is this:
Finder got an error: 2009-07-03 13:15:32.396
defaults[2674:613]
the domain/default pair of (com.apple.finder,AppleShowAllFiles0 does not exist
Folks having problems with my script - now four years old - might want to check out this Macworld article posted today. It talks about current solutions to showing hidden files as well as a few old solutions. http://bit.ly/blCFyp
your tip works like a wonder
thanks a lot mike!