Skip to content

Instantly share code, notes, and snippets.

@majman
Created April 6, 2020 18:41
Show Gist options
  • Save majman/21ba860d8fba56272a284ef6e504d42f to your computer and use it in GitHub Desktop.
Save majman/21ba860d8fba56272a284ef6e504d42f to your computer and use it in GitHub Desktop.
toggle visibility of desktop icons
display dialog "Desktop icons visible or hidden?" buttons {"Visible", "Hidden"} with icon 2 with title "Switch to presentation mode" default button 1
set switch to button returned of result
if switch is "Hidden" then
do shell script "defaults write com.apple.finder CreateDesktop -bool FALSE;killall Finder"
else
do shell script "defaults delete com.apple.finder CreateDesktop;killall Finder"
end if
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment