Switch to Previous Desktop Space

Yes, I use it throughout the macros that can be downloaded at Desktop Spaces • Macros for Navigation and Window Management.

tell application "System Events" ¬
to tell process "WhichSpace" ¬
to set temp to (title of menu bar items of menu bar 1)
return item 1 of temp

In my macros, that's all I use and need from WhichSpace, however...

If you really want to dig into this, you might find the following interesting:
[feature request] command line app · Issue #25 · gechr/WhichSpace

In that thread, you’ll see reference to davidpurnell/SpaceInfo: A command line app which returns MacOS spaces & display info

1 Like