jnewland

Spaces 'Application Assignments' and Applescript

<div style=”float:left;margin:10px;”> <script type=”text/javascript”><!– google_ad_client = “pub-5165033129816339”; //250x250, created 11/22/07 google_ad_slot = “4463239324”; google_ad_width = 250; google_ad_height = 250; //–></script> <script type=”text/javascript” src=”http://pagead2.googlesyndication.com/pagead/show_ads.js”> </script> </div>

Let’s face it - Spaces, Leopard’s new virtual desktop implementation, isn’t as polished as many of us would like it to be. It has more than it’s share of undocumented features, bugs, and annoyances.

One of my personal gripes with spaces it’s lack of keyboard shortcuts for managing what Spaces calls “Application Assignments”. I’d like to be able to quickly assign an application to all Spaces with a quick keypress. Also - I often find myself hunting through my Spaces for 3 or 4 Safari windows I’ve left in various places - it’d be nice if there was an easy way to collect all windows of a given app on the current Space.

So, this morning, I sat down and started hacking at some Applescripts to do just that. After wading through the bizarre way that Application Assignments are stored, I ended up with 4 Applescripts:

  • Assign to All Spaces - assigns the frontmost window to all spaces.
  • Assign to Space X - opens an input dialog asking you which space to assign the frontmost window to.
  • Collect on Current Space - brings all windows from the frontmost appliation to the current space.
  • Remove Assignments - remove any appliaction assignments the frontmost window may have.

Here’s a zip file of all 4:

Spaces Applescripts

These scripts are designed to be invoked via a keyboard shortcut via Quicksilver or FastScripts.

If you have any corrects / additions / suggestions as to how to improve these scripts, drop ‘em in the comments!