Pragmatism in code

This is a great little tip for showing hidden files in OSX. Normally all files are hidden, and so access to the hidden unix filesystem is not possible. This is easily overcome however. You can either permanently disable this feature by running the following command in terminal.

defaults write AppleShowAllFiles YES

or, if you need to change the visibility on a regular basis the following may be of more help

Open up the apple script editor and paste in the following code


set dotVisible to do shell script "defaults read AppleShowAllFiles"

on error errorMessage number errorNumber

set dotVisible to 0

end try

if dotVisible = "0" then

do shell script "defaults write AppleShowAllFiles 1"


do shell script "defaults write AppleShowAllFiles 0"

end if

tell application "Finder" to quit

delay 1

tell application "Finder" to activate

Now save this as an application - call it something like 'toggle_hidden_folders'

Clicking on the now toggles the visibility of hidden files and folders.