scripting spaces in 10.5 leopard?

I want to be able to script Spaces in 10.5 Leopard. I found a gui scripting way to find your current space in this MacOS X Hints post. This method also requires that you have the menu extra working. Is there a direct way to find the current space you are in without gui scripting and the menu extra?

When I tried to find out about spaces I tried the following applescript. It actually made spaces freak out a little before giving me an error. Very strange indeed!

tell application "Spaces"
	get properties
end tell

Also, I know you can use keystroke commands to change your current space. Again, is there a direct way to jump to a space?

FYI: I just found this post about Spaces… but it also uses gui scripting so it doesn’t address my problem. With Spaces being such an important feature of 10.5, you would think Apple would give us better tools for this. It seems at this point that maybe there isn’t a direct way. Hopefully somebody has figured it out though…


The poor scripting capabilities are provided by System Events

tell application "System Events"
	get properties of spaces preferences of expose preferences
end tell

No, maybe by simulating the keystroke