Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,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 2.50 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (4 votes cast)
 
[14,227 views]  

10.5: Activate Spaces in Exposť mode with one keypress | 7 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 whoever 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 Dec 10, '07 02:23:48PM

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 Dec 11, '07 04:06:05AM

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 Dec 11, '07 03:24:52PM

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 Dec 11, '07 05:23:41PM

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 Dec 17, '07 09:07:53AM

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 Sep 29, '08 01:21:04AM
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 | # ]
10.5: Activate Spaces in Exposť mode with one keypress
Authored by: GabLeRoux on Jun 01, '11 09:09:19AM

What I did:
Downloaded Better Touch Tool Website here This is awesome, must have.

made a script with script editor:

tell application id "com.apple.spaceslauncher" to launch
tell application "System Events"
key code 101 -- F9 - Expose All Windows
end tell

I just mixed the stuff I found right here because one or the other didn't work as I wanted :).

In BTT, I've set a touchpad gesture to Open Application / File / Script... and selected my script. Now I can rule my spaces :D

Hope that helps.



[ Reply to This | # ]