The Mac OS X 10.5 (also known as Leopard) introduced a few usability tweaks to window management and Finder that users of Linux desktop environments such as GNOME had been familiar with for quite some time. One of the new features was “Spaces” which is Apple’s implementation of virtual desktops. It includes the basic functionality such as a configurable number of screens, keyboard shortcuts and some tunable toys. It has some nice UI polish and takes advantage of Apple’s love of 3d swoosh effects when you use a keyboard shortcut or a dock icon to “Show Spaces”.
The “Show Spaces” effect shows all of the virtual desktops at once. It effectively presents a live scaled down view of each desktop with the wallpaper, dock, and a few other UI elements removed. You can click and drag applications between desktops and it shows an appropriate amount of visual cues. One nice feature is that you can activate “Show Spaces” and then activate “Expose” and you will see every window on every desktop at once. It is a nice feature and useful to the point that I never use “Show Spaces” without immediately hitting the “Expose” button.
Unfortunately Leopard seems to lack a built in configuration item for this so you have to resort to a small bit of Applescript to make this happen. This article from macosxhints.com has the basic idea but my newbie self had to fiddle around to figure out how to get it to work. So here is the basics:
- Launch the “Script Editor” tool either using Finder (Applications > AppleScript > Script Editor) or search for it using Spotlight or QuickSilver.
- A script editing window should appear. Cut and paste in the following:
tell application "System Events"
key code 100 -- F8 - Spaces
key code 101 -- F9 - Expose All Windows
end tell
Click the “Compile” button.
Save the file using File > Save As. Save it as File Format “Application”. Make sure “Startup Screen” is not checked or you be prompted for your permission to run the script every time you try to use it. Once you click “Save” you will have created an application file.
Close the Script Editor and open the “System Preferences” window using the Apple menu.
Open “Keyboard and Mouse” and find the mouse or keyboard shortcut you wish to bind this action to. For my use I use Mighty Mouse’s “side” buttons. Click on the option and choose “Other…”. Then select the application file that you just created.
It should now work. The downside of this approach is that you will be executing a script whenever you hit this button. You will see the AppleScript logo do a quick appearance and a bounce or two on your dock then it will disappear and the swoosh effect that normally accompanies “Show Spaces” will start.
I do have to say it amuses me to see a dozen or so terminal windows move around when Expose kicks in…
(Oh, Ben? You are behind and your default WordPress theme is hanging out…)