title: OSX Lion AppleScript : How to get current space # from mission control?
body: <p>I'm trying to figure out how to get the current space # from mission control.  Source would be helpful, but more helpful would be info on how to figure this out myself.  I've written a few applescripts, but more often than not it seems like any time I need to do something new (that I can't find dictionary documentation for) it falls under the category of &quot;tell this specific app (e.g. &quot;System Events&quot;) this very specific thing&quot; and I've no clue how I would actually figure that out.</p>
  <hr />
  <p>Specifically what I am trying to do:</p>
  <p>I <em><strong>hate</strong></em> the new mission control in OSX 10.7.  I want my spaces &quot;grid&quot; back since I used it all the time.  I used to navigate between spaces using arrow keys (e.g. <kbd>ALT</kbd>+<kbd>↑</kbd>) every few seconds.  Now I'm stuck with this clunky 1x9 array of spaces instead of an elegant 3x3 grid.  I've re-mapped all my spaces to use the number pad, which partially takes care of the problem (since it is a 3x3 grid), but only when I have an external keyboard attached.</p>
  <p>Basically, I want to be able to use <kbd>ALT</kbd>+<kbd>↑</kbd> and <kbd>↓</kbd> again, but to do so I need to detect the current space # so that I can switch from space 5--&gt;2, for example.</p>
  <p>Dave's answer below, although far more detailed than I expected, requires writing an app to do this (plus it still doesn't fully answer the question).  If it's at all possible, I'd rather just bind a few keys to an applescript.</p>