10.5: Assign a set of apps to Spaces via AppleScript

Jan 15, '08 07:30:00AM

Contributed by: cpt_power

This previous hint on using AppleScript with spaces got me to thinking about ways to get two (or more) different sets of spaces. So, for instance, you could have a 'work' Spaces set with Terminal, Safari, Mail, and an RSS Reader, and a 'home' Spaces set with Safari, Mail, GarageBand, and iPhoto.

The easieset way I've found to do this is with a couple of AppleScripts that basically look like the following:

set spaces_bindings to {|com.apple.terminal|:7, |com.apple.mail|:1, |com.ranchero.netnewswire|:4, |com.apple.iTunes|:65544}

tell application "System Events"
  tell expose preferences
    tell spaces preferences
      set application bindings to spaces_bindings
    end tell
  end tell
end tell
Note: Setting an app to 65544 will set it to "every space." You would then do a similar script as above for your 'home' space.

[robg adds: I haven't tested this one.]

Comments (0)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20080110210701395