/toggle_dot_files.sh Secret
Created
May 16, 2017 10:06
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
STATUS=`defaults read com.apple.finder AppleShowAllFiles 2>/dev/null` | |
if [ "$STATUS" == TRUE ]; then | |
STATUS=`osascript -e 'tell app "Finder" to display alert "Finder is showing hidden files." buttons {"Cancel", "Hide"}'` | |
else | |
STATUS=`osascript -e 'tell app "Finder" to display alert "Finder is not showing hidden files." buttons {"Cancel", "Show"}'` | |
fi | |
if [ "$STATUS" == "button returned:Show" ]; then | |
defaults write com.apple.finder AppleShowAllFiles TRUE | |
killall Finder | |
elif [ "$STATUS" == "button returned:Hide" ]; then | |
defaults write com.apple.finder AppleShowAllFiles FALSE | |
killall Finder | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment