Skip to content

Instantly share code, notes, and snippets.

@vacharanon
Created October 8, 2016 03:57
Show Gist options
  • Save vacharanon/c2daabb49d3393fb638d149211d3564f to your computer and use it in GitHub Desktop.
Save vacharanon/c2daabb49d3393fb638d149211d3564f to your computer and use it in GitHub Desktop.
AppleScript to show/hide all files
display dialog "Show all files?" buttons {"Show", "Hide", "Cancel"}
set result to button returned of result
if result is equal to "Show" then
do shell script "defaults write com.apple.finder AppleShowAllFiles -boolean true"
do shell script "killall Finder"
else if result is equal to "Hide" then
do shell script "defaults delete com.apple.finder AppleShowAllFiles"
do shell script "killall Finder"
end if
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment