Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save philipnewcomer/c1a43637e5953012ae4e62b4e8f1d85b to your computer and use it in GitHub Desktop.
Save philipnewcomer/c1a43637e5953012ae4e62b4e8f1d85b to your computer and use it in GitHub Desktop.
Toggle Hidden File Visibility
tell application "System Events"
set hiddenFilesDisplayStatus to do shell script "defaults read com.apple.finder AppleShowAllFiles"
set hiddenFilesNewDisplayStatus to "NO"
if hiddenFilesDisplayStatus is "NO" then
set hiddenFilesNewDisplayStatus to "YES"
end if
do shell script "defaults write com.apple.finder AppleShowAllFiles " & hiddenFilesNewDisplayStatus
do shell script "killall Finder"
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment