Turn Off Your Desktop [OS X Tips]

By

Example of dialog box created by AppleScript
A little AppleScript gives you an app that will hide the desktop whenever you want

If you’re using your Mac to give a presentation, you might not want everybody to see your messy desktop! If so, you can run a quick command that will hide your desktop icons.

To temporarily turn off the desktop, open a Terminal window (Finder->Applications->Utilities->Terminal) and type the following line:

defaults write com.apple.finder CreateDesktop -bool FALSE;killall Finder

Note that this will mean you can no longer right-click on the desktop or drag files there. The files there will still be accessible by using Finder to browse to your Desktop folder.

Typing the command
A simple command will hide all desktop detritus--essentially, turning it off

To restore things back to normal after your presentation, again open a Terminal window, but this time type the following:

defaults delete com.apple.finder CreateDesktop;killall Finder

Hey, presto! Everything should be back to normal. If not, log out and back in again.

With the use of a quick AppleScript, this Terminal command can even be turned into an standalone application that you can run before each presentation, saving the hassle of the command line.

Open AppleScript editor (Finder->Applications->Utilities->AppleScript Editor), and cut and paste the following code:

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

Click the Run button on the toolbar to test your script. You should see a dialog box appear with two buttons: Visible and Hidden. To make sure the app works OK, click Hidden to hide the icons, then run the app again and click Visible to reveal them again.

A little AppleScript gives you an app that will hide the desktop whenever you want

To save the AppleScript as an application, click File->Save As. Type a filename and, in the File Format dropdown list, select Application. Save the file, although not on your desktop–when the icons get hidden, you won’t be able to access it again to unhide them unless you use Finder.

Newsletters

Daily round-ups or a weekly refresher, straight from Cult of Mac to your inbox.

  • The Weekender

    The week's best Apple news, reviews and how-tos from Cult of Mac, every Saturday morning. Our readers say: "Thank you guys for always posting cool stuff" -- Vaughn Nevins. "Very informative" -- Kenly Xavier.