Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mayoff
Created June 20, 2017 22:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mayoff/bce0f84686e404bf7012be5b9d02d4da to your computer and use it in GitHub Desktop.
Save mayoff/bce0f84686e404bf7012be5b9d02d4da to your computer and use it in GitHub Desktop.
Services menu item to toggle Finder's desktop icons
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
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
@mayoff
Copy link
Author

mayoff commented Jun 20, 2017

Create a Service document in Automator using the above scripts, like this:

service setup in automator

@carrchr
Copy link

carrchr commented Jul 7, 2017

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