A quick tip today for those of you looking for a way to easily toggle hidden file visibility on OS X. I found myself toggling this setting frequently via Terminal.app when working with htaccess files, so I ended up putting together a little AppleScript to make life easier.
The script works as a toggle to turn the setting on or off. So, run it once to show hidden files, then run it a second time to hide them again.
Just paste this into ScriptEditor and you’re good to go. For added automation “Save as…” as an application and drop it in your Applications folder.
try set toggle to do shell script "defaults read com.apple.finder AppleShowAllFiles" if toggle = "True" then do shell script "defaults write com.apple.finder AppleShowAllFiles False" else do shell script "defaults write com.apple.finder AppleShowAllFiles True" end if do shell script "killall Finder" end try
Alternatively, you can just download the script here.
