Skip to content

Instantly share code, notes, and snippets.

@dm-z
Last active January 3, 2016 11:08
Show Gist options
  • Save dm-z/8453713 to your computer and use it in GitHub Desktop.
Save dm-z/8453713 to your computer and use it in GitHub Desktop.
Show/Hide hidden files in OS X Finder
display dialog "Show Hidden Files..." & return & "Finder will relaunch!" buttons {"Show hidden files", "Hide hidden files", "Cancel"} default button 3 with title "Hidden files OS X helper"
copy the result as list to {buttonpressed}
try
if the buttonpressed is "Hide hidden files" then do shell script "defaults write com.apple.finder AppleShowAllFiles FALSE"
if the buttonpressed is "Show hidden files" then do shell script "defaults write com.apple.finder AppleShowAllFiles TRUE"
if the buttonpressed is "Cancel" then return
end try
do shell script ("killall Finder")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment