Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.6: Combining Spaces and Exposť in a single swipe System 10.6
Snow Leopard only hintThis hint shows how to combine Spaces and Exposť to show all open windows on all workspaces, using AppleScript and BetterTouchTool.

Lion may have Mission Control but for Leopard/Snow Leopard users, it can be a pain to find a particular window among all the workspaces. The following AppleScript activates Spaces and Exposť together and orders windows by alphabetical order:
tell application "System Events"
  key code 100 -- F8 - Spaces
  key code 101 -- F9 - Exposť All Windows
  keystroke "1" using {command down}
end tell
It assumes you're using the default keys for Spaces and Exposť. Copy and Paste the script into AppleScript Editor, save it as a script and then add it as a gesture in BetterTouchTool under the Global section. I use the three finger down swipe gesture to activate the script.

The more RAM you have, the better -- on a machine with 2GB RAM, it took a second or two to run the script, whereas it runs instantly on a 8GB machine.

You can get BetterTouchTool at http://www.boastr.de. It's an amazing program to customize trackpad and mouse gestures to do pretty much anything.

[crarko adds: I haven't tested this one.]
    •    
  • Currently 3.83 / 5
  You rated: 3 / 5 (6 votes cast)
 
[6,014 views]  

10.6: Combining Spaces and Exposť in a single swipe | 11 comments | Create New Account
Click here to return to the '10.6: Combining Spaces and Exposť in a single swipe' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.6: Combining Spaces and Exposť in a single swipe
Authored by: lankox on May 26, '11 08:38:43AM

F8 and F11 are not the standard keys for Expose and Spaces. They are F9 and F3. Can we get the key codes for those?



[ Reply to This | # ]
10.6: Combining Spaces and Exposť in a single swipe
Authored by: lankox on May 27, '11 08:49:46AM

I meant to say that on a MBP, F8 shows desktop and F3 is Spaces, so we need a F3 and F11 script. What changes have to be made t the above script? Thanks!



[ Reply to This | # ]
10.6: Combining Spaces and Exposť in a single swipe
Authored by: NaOH-Lye on May 27, '11 04:07:39PM

Here are all the F-Key key codes:

F1: 122
F2: 120
F3: 99
F4: 118
F5: 96
F6: 97
F7: 98
F8: 100
F9: 101
F10: 109
F11: 103
F12: 111
F13: 105
F14: 107
F15: 113
F16: 106
F17: 64
F18: 79
F19: 80



[ Reply to This | # ]
10.6: Combining Spaces and Exposť in a single swipe
Authored by: lankox on May 27, '11 08:13:40PM

Thanks!



[ Reply to This | # ]
10.6: Combining Spaces and Exposť in a single swipe
Authored by: Andrew J Freyer on May 26, '11 08:53:51AM

I really like this hint. BTT is a huge part of my workflow, as are spaces and expose. I am surprised I hadn't thought of this. Very smart!

---



[ Reply to This | # ]
Watch out for modifier keys
Authored by: SeanAhern on May 26, '11 02:07:46PM

I had this one bound to Command-4-finger-swipe in BTT. It works, but I have to get my finger off the Command key very quickly. Otherwise, System Events thinks I'm typing Command-F8 and Command-F9 instead of the F8 and F9 it wants. Command-F8 is set to launch iTunes and start playing.

See this discussion.

I likely have to bind it to something else. Too bad I can't use the Shift key in a BTT gesture.



[ Reply to This | # ]
10.6: Combining Spaces and Exposť in a single swipe
Authored by: scottbayes on May 26, '11 07:03:49PM
but I have to get my finger off the Command key very quickly. Otherwise, System Events thinks I'm typing Command-F8 and Command-F9 instead of the F8 and F9 it wants.

I see that (in 10.6.7 at least) the System Events dictionary contains:

key modifiers (command/control/none/option/shift) : modifiers used for a specific function key, passed as string or list

You might try

key code 100 using none -- F8 - Spaces

or

key code 100 using none down -- F8 - Spaces

Sorry, haven't tested this.

[ Reply to This | # ]

10.6: Combining Spaces and Exposť in a single swipe
Authored by: miceblue on Jun 02, '11 06:00:25PM

This might sound stupid, but how do you add an AppleScript file to BTT? I use BTT all the time but I haven't heard of using an AppleScript with it.



[ Reply to This | # ]
10.6: Combining Spaces and Exposť in a single swipe
Authored by: miceblue on Jun 06, '11 03:32:16AM

Edit: Oh wait, I found the answer to my question. Under the predefined actions list, you can select "Open Application/File/Script." Once you select that, it asks to locate the Application/File/Script to open. Then you simply select the AppleScript file you made and assign a gesture to activate the script.

Thank you for the helpful tip, this is really useful!



[ Reply to This | # ]
10.6: Combining Spaces and Exposť in a single swipe
Authored by: OmniDragon on Jun 15, '11 05:20:47AM

I tested this and it works...with a little tweaking on my end. I'm using the Apple Wireless keyboard, so F8 is Play/Pause and F3 is Exposť. So thanks to NaOH-Lye for posting the keycodes. I then added the exposť and spaces functionality via keyboard shortcuts in System Preferences to F5 and F6, since by default, they do nothing.

I also had to take out the part in the script that orders the windows alphabetically, since it was either happening too quick or too slow because when it activated, Safari went to my top bookmark "command + 1", which is youtube, and I didn't feel like adding a delay in the script to tweak it. Adding it as a four-finger gesture didn't seem to work so well, so yeah, I added it as a three finger swipe in BetterTouchTool and it works flawlessly.



[ Reply to This | # ]
10.6: Combining Spaces and Exposť in a single swipe
Authored by: OmniDragon on Jun 15, '11 08:03:02AM

"I also had to take out the part in the script that orders the windows alphabetically, since it was either happening too quick or too slow because when it activated, Safari went to my top bookmark "command + 1", which is youtube, and I didn't feel like adding a delay in the script to tweak it."

And now I've added it back in, as it's working just fine. I don't know what happened with it before. Maybe it was just that I hadn't switched it to a 3 finger gesture yet, was still using 4 fingers so there were a few hiccups with it.



[ Reply to This | # ]