Hide Mac Desktop Icons

If you are like most mac users, your desktop get polluted with large numbers of icons from files that you save to your desktop and then never quite get time to “file away”. This trick with the below applescript / shellscript will cover your bad habit and make you look much more organized / professional than you are when it counts 😉

Please note you are doing the below at your own peril and I am not responsible what may or may not happen to your computer /data.  You might want to check out the man page for the command used for more information:


Step 1: Launch Script Editor


Step 2: Create two scripts:

1. Paste in the following:

do shell script “chflags hidden ~/Desktop/*”

2. Go to File -> Save As

3. Save the script to:

Macintosh HD/Users/youruser/Library/Scripts/Hide Desktop

4. Under Script Editor File menu select New

5. Paste in the following:

do shell script “chflags nohidden ~/Desktop/*”

6. Go to File -> Save As

7. Save the script to:

Macintosh HD/Users/youruser/Library/Scripts/Show Desktop

Step 3 – Add scripts to menu bar

1.  Launch Applescript Utility

(Macintosh HD/Applications/AppleScript/AppleScript Utility)

2.  Make sure there is a check next to “Show Script menu in menu bar”

Note that if you uncheck Show Computer scripts it will remove from view all the scripts that ship as part of OS X.  That is what I did to simplify my menu but that is your call.

Step 4 – Go to the menu bar (upper right) and click on the scroll icon.  You should now see the two scripts.  Click on them to hide or unhide the desktop.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.