Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Toggle Hidden File Visibility
tell application "System Events"
set hiddenFilesDisplayStatus to do shell script "defaults read AppleShowAllFiles"
set hiddenFilesNewDisplayStatus to "NO"
if hiddenFilesDisplayStatus is "NO" then
set hiddenFilesNewDisplayStatus to "YES"
end if
do shell script "defaults write 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
You can’t perform that action at this time.