Skip to content

Instantly share code, notes, and snippets.

@sloanlance
Last active February 3, 2017 15:43
Show Gist options
  • Save sloanlance/0e1cda86c44aa9960cf5c2ebb94fed6d to your computer and use it in GitHub Desktop.
Save sloanlance/0e1cda86c44aa9960cf5c2ebb94fed6d to your computer and use it in GitHub Desktop.
AppleScript: Toggle visibility of hidden files and folders in Finder
-- Place this in ~/Library/Scripts to make it available in the AppleScript menu.
do shell script ¬
(POSIX path of ((path to me as text) & "::")) ¬
& "toggleHiddenFiles.sh"
# Place this in ~/Library/Scripts along with "Toggle Hidden Files.scpt".
# If this is to be used from a shell, make a symlink to this file from some directory in PATH
[[ $(defaults read com.apple.finder AppleShowAllFiles) = 1 ]] && b=false || b=true
defaults write com.apple.finder AppleShowAllFiles -bool $b
killall Finder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment