Is there any way in AppleScript, or from the CLI, to get the name of the current Desktop/Space?
I use Keyboard Maestro to perform some actions. It would be useful if I could get the name of the current Mission Control Desktop/Space (For me 'Desktop 1' to 'Desktop 8') so that when the script ends I can then flip back to wherever I was before.
I would ideally like a way to do it in either AppleScript or a CLI/BASH, or if the value is available in a file anywhere?
Currently trying to use the Mission Control swipe up to show the desktop/space names and then use the found image in KM but it is very hit and miss for some reason. There must be a better way surely!