Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

sentientbear

macrumors newbie
Original poster
Jan 9, 2014
3
0
Hi all,

I want a show desktop icon in the dock (yes, as in Windows XP and 7). I can't figure out how to do this, including with scripting. Any help would be much appreciated!!

Nota bene: I do NOT want to use keyboard or trackpad gestures.
 
use the Finder icon that's always in your dock. and, under Finder preferences, set a new window to open with "Desktop"...

EDIT: or, sorry...just open your Home folder, drag the Desktop folder to the right side of your dock!!
 
use the Finder icon that's always in your dock. and, under Finder preferences, set a new window to open with "Desktop"...

EDIT: or, sorry...just open your Home folder, drag the Desktop folder to the right side of your dock!!

I may be wrong but that doesn't quite sound like what the OP is trying to do. All that does is access the files on the desktop. Sounds like he is looking for a way to "show desktop", meaning like take all the windows off the desktop...as does the taskbar icon performs in...."cough cough" Windows.:cool:
 
use the Finder icon that's always in your dock. and, under Finder preferences, set a new window to open with "Desktop"...

EDIT: or, sorry...just open your Home folder, drag the Desktop folder to the right side of your dock!!

That doesn't actually show the desktop though.

Why don't you use 4 finger spread to show desktop? It is much easier in my opinion.

I dunno maybe they use a button mouse.

You could use a "hot corner".

See in System Preferences / Mission Control.

... Did any of you even read the OP?


To actually answer the question...

  1. Open Automator
  2. Make a new Application (command + n)
  3. Add the action 'Run Shell Script' to the flow
  4. Delete the default text 'cat'
  5. Paste in this code
    Code:
    open /Applications/Mission\ Control.app --args 1
  6. Save the Application as Desktop
    • Make sure the File Format is Application and not Workflow when saving
    • Also it's probably best to save it in /Applications
  7. Navigate to wherever you saved the Application in Finder
  8. Drag the Application to your dock

Congrats you just made your first Automator item! Now just click the icon in your dock to show the desktop.

Here's a link to a nice icon for the app since the default automator icon doesn't really make me think 'show desktop'. http://www.artofadambetts.com/weblog/2006/09/updated-desktop-icon/

Note for others who may be interested:

Mission Control -- open /Applications/Mission\ Control.app
Show Desktop -- open /Applications/Mission\ Control.app --args 1
Application Windows -- open /Applications/Mission\ Control.app --args 2
Dashboard -- open /Applications/Dashboard.app

Alternate open command

open -a "Mission Control"
open -a Dashboard
 
Last edited:
  • Like
Reactions: peege and marymc
... Did any of you even read the OP?
I don't like your comment.

I DID read the OP, for your information.

I have the right to suggest another solution to see the Desktop without using the keyboard or a trackpad gesture.

And, in MY opinion, a hot corner is a good (and OS native) solution.
 
WHOOAAA... you actually answered my question! THANK YOU!

It's like you actually read what I wrote and knew what you were talking about!


Got time for a follow-up question? (If not, that's fine!) Do you know if there's a way to restore the application windows to their previous state by clicking the dock icon again? (Basically, exactly replicating the Windows show desktop function.) I'm totally not familiar with Automator, but this seems like something that might be simple enough, e.g., "on click 1 {X}, on click 2 {Y}." Using "Application Windows -- open /Applications/Mission\ Control.app --args 2" in Automator provides that function (but with an error msg...!), though it requires a separate dock icon.




That doesn't actually show the desktop though.



I dunno maybe they use a button mouse.



... Did any of you even read the OP?


To actually answer the question...

  1. Open Automator
  2. Make a new Application (command + n)
  3. Add the action 'Run Shell Script' to the flow
  4. Delete the default text 'cat'
  5. Paste in this code
    Code:
    open /Applications/Mission\ Control.app --args 1
  6. Save the Application as Desktop
    • Make sure the File Format is Application and not Workflow when saving
    • Also it's probably best to save it in /Applications
  7. Navigate to wherever you saved the Application in Finder
  8. Drag the Application to your dock

Congrats you just made your first Automator item! Now just click the icon in your dock to show the desktop.

Here's a link to a nice icon for the app since the default automator icon doesn't really make me think 'show desktop'. http://www.artofadambetts.com/weblog/2006/09/updated-desktop-icon/

Note for others who may be interested:

Mission Control -- open /Applications/Mission\ Control.app
Show Desktop -- open /Applications/Mission\ Control.app --args 1
Application Windows -- open /Applications/Mission\ Control.app --args 2
Dashboard -- open /Applications/Dashboard.app

Alternate open command

open -a "Mission Control"
open -a Dashboard
 
Edit1:

Clicking anything (other than the desktop app which would relaunch show desktop) in the dock while in "Show Desktop" will exit that view

Edit2:

You can:

  • Put the mission control app in the dock
  • Right click the icon
  • click show desktop
  • click the icon again to exit

Edit3:

The alternate Automator App (which is just a toggle you click) would be:

Code:
myval=$(defaults read ~/.desktop.plist "on_desktop")
if ($myval); then	
	defaults write ~/.desktop.plist "on_desktop" 'false'
else
	open -a "Mission Control" --args 1
	defaults write ~/.desktop.plist "on_desktop" 'true'
fi

Note that this will only work properly in the dock because clicking any item in the dock while in "Show Desktop" automatically exits that view.

---

Got time for a follow-up question? (If not, that's fine!) Do you know if there's a way to restore the application windows to their previous state by clicking the dock icon again? (Basically, exactly replicating the Windows show desktop function).

I do not know a way to exactly replicate the windows button because I don't know of any way to check if you're currently "viewing the desktop" or not which would be required to be able to get the Application to work 100% perfectly.

I'm totally not familiar with Automator, but this seems like something that might be simple enough, e.g., "on click 1 {X}, on click 2 {Y}."

When you click the App in the dock it runs the application (which then quits almost instantly). I am unaware of a way to monitor mouse clicks. Like that.

Using "Application Windows -- open /Applications/Mission\ Control.app --args 2" in Automator provides that function (but with an error msg...!), though it requires a separate dock icon.

The part "Application Windows -- " was a descriptor you're only supposed to use the part after the double dash "open /Applications/Mission\ Control.app --args 2". Also Application windows is not what you'd want. Just clicking anything in the dock will exit the desktop view.
 
Last edited:
Awesome! Thanks!


Edit1:

Clicking anything (other than the desktop app which would relaunch show desktop) in the dock while in "Show Desktop" will exit that view

Edit2:

You can:

  • Put the mission control app in the dock
  • Right click the icon
  • click show desktop
  • click the icon again to exit

Edit3:

The alternate Automator App (which is just a toggle you click) would be:

Code:
myval=$(defaults read ~/.desktop.plist "on_desktop")
if ($myval); then	
	defaults write ~/.desktop.plist "on_desktop" 'false'
else
	open -a "Mission Control" --args 1
	defaults write ~/.desktop.plist "on_desktop" 'true'
fi

Note that this will only work properly in the dock because clicking any item in the dock while in "Show Desktop" automatically exits that view.

---



I do not know a way to exactly replicate the windows button because I don't know of any way to check if you're currently "viewing the desktop" or not which would be required to be able to get the Application to work 100% perfectly.



When you click the App in the dock it runs the application (which then quits almost instantly). I am unaware of a way to monitor mouse clicks. Like that.



The part "Application Windows -- " was a descriptor you're only supposed to use the part after the double dash "open /Applications/Mission\ Control.app --args 2". Also Application windows is not what you'd want. Just running the normal Mission Control app with no arg will exit the desktop view.
 
I don't like your comment.

I DID read the OP, for your information.

I have the right to suggest another solution to see the Desktop without using the keyboard or a trackpad gesture.

And, in MY opinion, a hot corner is a good (and OS native) solution.

And, I believe, SO much simpler than writing an Automator script. By the way, using the hot corner replicates a gesture on the trackpad, spread with thumb and 3 fingers (opposite reverses). Some people over-think things.
 
Workaround to return open windows after 'Showing desktop"

Thank you sentientbear and w0lf - this is extremely helpful.

Also, FYI, once you click the automator/script icon to 'show desktop', you can return your open windows by clicking in grey space in your Dock bar (careful not to click on an actual icon). I generally click on the separator between the Trash icon and my other Applications to do so.

----------

Thank you sentientbear and w0lf - this is extremely helpful.

Also, FYI, once you click the automator/script icon to 'show desktop', you can return your open windows by clicking in grey space in your Dock bar (careful not to click on an actual icon). I generally click on the separator between the Trash icon and my other Applications to do so.
 
Oooh! I LOVE this thread! I have been wanting a "show desktop" trick for YEARS! I was happy to learn that Command-F3 trick (I'm not on an Apple Keyboard right now, so I "think" it is Command-F3), but now, reading this thread, I'm excited to get back on my iMac and try this out.

If it really works (sounds like it does), we should all throw a Party for the poster "w0lf" for such a cool suggestions!!

(I'll bring the Pumpkin Cupcakes with Sprinkles!) :D
 
Such sarcasm in this thread. :rolleyes:

I think hot corners or a gesture would be easier, but the OP wanted an icon/script solution. Whatever works for them.

I use a script to copy all the files and folders into another folder on my desktop for USB flash drive backup, I could just drag with the alt key, but I prefer a right-click script. Variety is the spice of life.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.