10.6: A Service to show/hide hidden files
Jul 20, '10 07:30:00AM
Contributed by: colmiak
There are many ways to show and hide the various hidden files and folders in Mac OS X. This one is an update to an older Automator workflow method. The previous method was to create a plug-in in Automator; now a pair of Services are used, so this hint only applies to Snow Leopard. Refer to the previous hint for usage in either Leopard or Tiger.
Here's how to do it:
- Launch Automator and choose Service as your template. (Be careful in the next steps if you copy and paste the code that the apostrophes and quotes come through as plain text.)
- On the left side, use the search bar to find the 'Run Shell Script' action (it's in Utilities) and drag three instances of that action over to the right side.
- At the very top on the right where is says 'Service receives selected' choose 'files or folders' in 'Finder.'
- In the first 'Run Shell Script' box type the following:
defaults write com.apple.finder AppleShowAllFiles -bool TRUE
- In the second box type the following:
osascript -e 'tell application "Finder" to quit';
- In the third box type the following:
osascript -e 'tell application "Finder" to activate';
- Save the file as Show Hidden Files.
- Now go back to the first 'Run Shell Script' box at the top and change the word TRUE to FALSE.
- It should now read:
defaults write com.apple.finder AppleShowAllFiles -bool FALSE
- Save this file as Hide Hidden Files.
That's all, now when you right click a file or folder, these options will show up at the bottom of the list.
To delete these Services go to ~/Library/Services and just move both files to the trash.
[crarko adds: I tested this, and it works as described.]
Comments (22)
Mac OS X Hints
http://hints.macworld.com/article.php?story=20100719001040829