Ever want to hide ALL your applications and start with a clear, swept off desktop on your Mac? Yeah, there’s Exposé, but that’s not the same as what we’ll see here. When you show your desktop via Exposé you’re not changing the state of your applications to hidden – so as soon as you switch to an application the others will all be visible too.
If you’ve used Windows you may have used the Show Desktop icon in the taskbar to minimize all windows. We’re not going to minimize, we’re going to hide. But the end effect is the same. You’re looking at your desktop with nothing in your way.
How do we do this? A very short and simple Applescript. With one small concession.
If you’ve ever tried to hide ALL your applications you probably know what our obstacle is.
Try this: Switch to Finder and hit Command-Option-H. That hides all applications except Finder. Once they're hidden try hitting Command-H to hide the Finder itself. It doesn't work.
So here’s a workaround that’s acceptable to me: Our Applescript will hide the windows of all applications except the Finder. Then it will CLOSE all the Finder windows. The end result is a clean desktop with application windows that stay out of sight until you summon them back into view.
Optionally, you could include the 3 lines of the script after the line “Close every window” (commented out with dashes in the image below) to open up a single Finder window to a specified folder and use that as your starting point.
Once you’ve created the script you need a way to kick it off. I use TextExpander for a lot of these things. TexExpander is a fantastic text replacement utility that can also run Applescripts when you type certain characters. For example, Murphy might type dsktp or ddesk to make TextExpander run our script and display the clean desktop. There’s a lot more to TextExpander than running Applescripts, but I find it very handy in that capacity. Instead of memorizing somewhat arbitrary key combinations you can make up a code – so your shortcuts are more like keywords with meaning than shortcuts that generally only carry one letter. Murphy covered TexExpander here.
As an alternate check out FastScripts from Red Sweater Software. FastScripts lets you assign a script to a keyboard shortcut. And it has powerful features for helping you manage your script library. If you’re a heavy Applescripter you probably already know about it. If not, take a look at the features.