Skip to content

Instantly share code, notes, and snippets.

@n8henrie
Created March 17, 2013 16:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save n8henrie/5182340 to your computer and use it in GitHub Desktop.
Save n8henrie/5182340 to your computer and use it in GitHub Desktop.
-- Relevant post here: http://n8henrie.com/2012/08/show-or-hide-hidden-files-on-your-mac-with-applescript/
set question to display dialog "Show or hide hidden files?" & return & "Don't that forget this will relaunch Finder." buttons {"Show hidden files", "Hide hidden files", "Cancel"}
set theAnswer to button returned of result
if theAnswer is "Show hidden files" then
do shell script "defaults write com.apple.Finder AppleShowAllFiles TRUE && killall Finder"
end if
if theAnswer is "Hide hidden files" then
do shell script "defaults write com.apple.Finder AppleShowAllFiles FALSE && killall Finder"
end if
if theAnswer is "Cancel" then
return
end if
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment