Every now and then a come across a new trick to make my life a little easier within OS X. This post is about yet another. Displaying hidden files in Windows was relatively easy. Simply update an option in your settings and you get to see all your hidden files with the potential to mess everything up on your machine to your hearts content. So why should it be any different on OS X. Ahhhh but it is. To view hidden files on OS X you had to go into Terminal, run a pair of commands to display the files, and when you’re done doing whatever you needed to do, run a set of commands again to hide the hidden files, again. I had been doing this ever since I switched to Mac. Until a couple weeks ago when I came across this handy tutorial written by Matt Swain.

At the time of this post, these instructions, and other information about this topic, could be found on Matt’s Mac OS X Tips Website, but just in case a black hole were to ever absorb the site, I’ve included the instructions to create a keyboard shortcut using Automator below, but credit is due to Matt for his helpful post.

While Apple helpfully provided a keyboard shortcut for use in open and save dialogs, they didn’t do the same for normal Finder windows. Luckily, it’s not too tricky to set up a keyboard shortcut yourself.

To start, open up Automator (in the Applications folder) and choose a Service template. From the library choose “Run Shell Script” and drag it across to the workflow area. In the text box paste the following command:

STATUS=`defaults read com.apple.finder AppleShowAllFiles`
if [ $STATUS == YES ];
then
    defaults write com.apple.finder AppleShowAllFiles NO
else
    defaults write com.apple.finder AppleShowAllFiles YES
fi
killall Finder

Finally, change the “text” drop-down menu to “no input” and then save you workflow as “Toggle Hidden Files”.

Now if you go to the Finder menu and look under Services, you should find a “Toggle Hidden Files” option. To add the keyboard shortcut, go to the Keyboard section of System Preferences and click the Keyboard shortcuts tab. Select Services from the list on the left, then scroll down to the bottom of the list on the right to find “Toggle Hidden Files”. Double-click on the area to the right of it, then press the keyboard shortcut you want. I used Command-Shift-. (dot).

Leave a Reply

You must be logged in to post a comment.

  • Oops Twitter isnt working at the moment