Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.