Mac OS X Leopard has a virtual desktop environment called Spaces. I want to programmatically determine in which space the user is currently located .
Cocoa is preferred , but AppleScript is acceptable if there is no other way.
I saw a couple of AppleScript implementations, but the methods that they used seemed too hacked for use in production code (one relied on the cause of the error and then parsed the error message to get the current space, and the other Spaces menu polled GUI)
source
share