How to see .htaccess under Mac OS X
One the the most frustrating things I encountered developing under Mac is when I’m trying to access .htaccess files. By default hidden files under Mac are, well, hidden.
I found a couple of ways of showing hidden files, but none of them was very convinient. The closest thing I came to regarding ease of use was simply opening the Terminal and writing a couple of commands to show the hidden files. Then I discovered Automator, a hidden gem, probably one the best tools you can find on Mac OS X.
What Automator does is simply let’s you create workflows of commands and actions. So for example I can mimic the actions and commands I’m doing when I open my Terminal and write the show hidden file command and make it automatic.
So here it is:
Step 1:
Open Automator. (It’s in your Applications folder)
Step 2:
We need to mimic our actions, in Automator we need to use a Shell Script. In the library pane go to Automator then drag Run Shell Script onto your workflow.

Step 3:
In that little box that appears write the following commands:
defaults write com.apple.Finder AppleShowAllFiles TRUE
killall Finder
The first line tells Automator to show all the files and the second line to restart Finder. This command is needed to show the hidden files in Finder.

Step 4:
Save this workflow as a Finder plugin. You can do this by going to File -> Save as Plug-in. In the following window write a name for this action and make sure you select the Plug-in for: Finder.

Step 5:
For hiding the files repeat from Step 2 except you write the following commands in the textbox:
defaults write com.apple.Finder AppleShowAllFiles FALSE
killall Finder
Save it as plug-in.
Testing it:
Now go to Finder -> Right Click and under the Automator popup you can see your 2 workflows.

That’s it. Now every time you want to show your hidden files you can do it from Finder.


Comments
August 21st, 2008
This is really great and easy to follow. I will definitely need to check out Automator’s features more! Thanks for the tips.
August 23rd, 2008
Intersting but why not just install TinkerTool
August 23rd, 2008
I don’t like installing unnecessary apps if I can do it with the apps already installed.
September 4th, 2008
Thanks Man! That was helpful!
September 10th, 2008
Hey, so i tried to test this, but when i right click on Finder it doesn’t even show Automator as an option. Maybe you could help me out. Thanks.
September 10th, 2008
Automator is built-in since Mac OS X Tiger (10.4). If you have Tiger check out the Applications folder for Automator, maybe it’s not installed (it has to be, because it’s built-in)
February 15th, 2009
Thanks for this! Had never used the automator before.
February 15th, 2009
@Marcel You’re welcome. There’s a lot more to Automator than this article. You can create basically anything with it…
December 16th, 2009
Thanks for the tip. I wonder though is there a way to ONLY show .htaccess files, not all system files?
B/C as a web dev I rarely need to see other system files, just .htaccess.
Thanks!