Skip to content

Instantly share code, notes, and snippets.

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