Skip to content

Instantly share code, notes, and snippets.

@abhishekdev
Created March 14, 2012 17:19
Show Gist options
  • Save abhishekdev/2038016 to your computer and use it in GitHub Desktop.
Save abhishekdev/2038016 to your computer and use it in GitHub Desktop.
Toggle Show/Hide hidden Files on Mac OS X
tell application "Finder" to quit
try
do shell script "defaults read com.apple.finder AppleShowAllFiles"
set OnOff to result
on error
set OnOff to "0"
end try
if OnOff = "0" then
set OnOffCommand to "defaults write com.apple.finder AppleShowAllFiles 1"
else
set OnOffCommand to "defaults write com.apple.finder AppleShowAllFiles 0"
end if
do shell script OnOffCommand
delay 1
tell application "Finder" to launch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment