Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,000 hints and counting!

10.5: Activate Spaces in Exposé mode with one keypress System 10.5
As described in this hint, you can use Spaces and Exposé together at the same time -- just press F8 followed by F9. But how can you bind both operations to a single key? Use a tiny AppleScript with GUI Scripting turned on (Enable Access for Assistive Devices in the Universal Access System Preferences panel), and Quicksilver triggers to assign it to a key. In my setup, I've assigned Spaces to F7, Exposé to F8, and Spaceposé to F11; it works like a charm. Here is the Spaceposé script in all of it's glory:
tell application "System Events"
  key code 98 -- F7 - Spaces
  key code 100 -- F8 - Expose All Windows
end tell
Here are the key codes for all the function keys:
  • F1: 122
  • F2: 120
  • F3: 99
  • F4: 118
  • F5: 96
  • F6: 97
  • F7: 98
  • F8: 100
  • F9: 101
  • F10: 109
  • F11: 103
[robg adds: I haven't tested this one...]
    •    
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[8,021 views]  

10.5: Activate Spaces in Exposé mode with one keypress | 6 comments | Create New Account
Click here to return to the '10.5: Activate Spaces in Exposé mode with one keypress' hint
The following comments are owned by whomever posted them. This site is not responsible for what they say.
10.5: Activate Spaces in Exposé mode with one keypress
Authored by: asmeurer on Mon, Dec 10 2007 at 2:23PM PST
Where did you find that index of key presses. This could finally could be a way for me to remap my spaces to other keys than the default Ctrl-#.

[ Reply to This | # ]
10.5: Activate Spaces in Exposé mode with one keypress
Authored by: PizzaCake on Tue, Dec 11 2007 at 4:06AM PST
Default setup

tell application "System Events"
key code 100 -- F8 - Spaces
key code 101 -- F9 - Expose All Windows
end tell

[ Reply to This | # ]
10.5: Activate Spaces in Exposé mode with one keypress
Authored by: PizzaCake on Tue, Dec 11 2007 at 3:24PM PST
I used automator to create a workflow consisting of run applescript (insert code in dialog box). Saved as application and assigned to middle mouse button of my mighty mouse.

[ Reply to This | # ]
10.5 badge/icon
Authored by: jecwobble on Tue, Dec 11 2007 at 5:23PM PST
Rob, this hint doesn't seem to have the 10.5 badge/icon.

[ Reply to This | # ]
10.5: Activate Spaces in Exposé mode with one keypress
Authored by: PizzaCake on Mon, Dec 17 2007 at 9:07AM PST
tell application "System Events"
key code 100 -- F8 - Spaces
key code 101 -- F9 - Expose All Windows
end tell

I found when using an Automator workflow the time taken to active spaces and expose really slow. However enter the above in script editor and save as an application bundle and put the application in the dock or assign a mouse button etc. to the application and now spaces and expose will activate almost instantaneously :) Copy the spaces icon to the application so it looks good.

[ Reply to This | # ]
10.5: Activate Spaces in Exposé mode with one keypress
Authored by: fmoosvi on Mon, Sep 29 2008 at 1:21AM PDT
Hey guys, I'm not sure if Apple changed something in later Leopard releases but the trick above doesn't work. if you have spaces first it opens spaces but doesn't turn expose on after. vice versa is true if you put exposes first in the apple script. I googled and put together this solution - your apple script would be simply:

tell application id "com.apple.exposelauncher" to launch
tell application id "com.apple.spaceslauncher" to launch
and that should work. Unfortunately, it's non-ideal as it does expose THEN spaces wheras you want spaces then expose for it to look nicer. Let me know if anyone discovers a better trick.

[ Reply to This | # ]