Created
June 20, 2017 22:39
-
-
Save mayoff/bce0f84686e404bf7012be5b9d02d4da to your computer and use it in GitHub Desktop.
Services menu item to toggle Finder's desktop icons
This file contains hidden or 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
if [[ $(defaults read com.apple.Finder CreateDesktop 2>/dev/null) = YES ]]; then | |
defaults write com.apple.Finder CreateDesktop NO | |
else | |
defaults write com.apple.Finder CreateDesktop YES | |
fi |
This file contains hidden or 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
if application "Finder" is running then | |
tell application "Finder" to quit | |
end if | |
set waitCount to 0 | |
repeat while application "Finder" is running and (waitCount) < 20 | |
delay 0.1 | |
set waitCount to waitCount + 1 | |
end repeat | |
tell application "Finder" to launch |
Wait. What? So the Desktop becomes blank after you do this?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Create a Service document in Automator using the above scripts, like this: