One drag about Apple's Spaces implementation in Leopard is that there is no way to access Spaces via AppleScript. While you can use AppleScript to select indvidual spaces by simulating keystrokes, it'd be nice to have some way to find what the current space is via AppleScript.
Well, using PreFab Software's excellent UIBrowser, I was able to figure out how to accomplish that precise task with AppleScript.
(I believe you'll need to check Enable Access for Asssistive Devices in the Universal Access pane of System Preferences, if you haven't already, for this to work. You'll also need the Spaces menubar extra to be visible, which you can enable in the Spaces pane of System Preferences.)
The script will return the variable theCurrentSpace with the number of the currently displayed space. You can use that information in any way your scripting or automation imagination desires. Here is the AppleScript; copy and paste into Script Editor: [robg adds: I haven't tested this one.]
•
[10,960 views]

