trzeciakp trzeciakp - 1 year ago 223
AppleScript Question

osx - script to get current desktop number

Is there a way to get current desktop/space number on osx programatically?

I've found this questions but it seems to be a little bit outdated:
OSX Lion AppleScript : How to get current space # from mission control?

I've also found this: but unfortunately it does not work.

Answer Source

Since recent OS version, it is no longer possible to access via script to spaces. the only thing I found is how to get, via Applescript the name/path of desktop picture on current space :

tell application "Finder" to set A to (desktop picture) as string

Except that, since Yosemite (at least !) Applescript dictionary no longer contain space scriptable elements.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download