I'm trying to adapt an AppleScript that is using System Events, based on calling the front window of the application I want to control.
The script is working okay if the application is in the same Space1 as Script Editor.
The window is called Global, and the app is Capture One 11.
tell application "System Events" repeat with theTbarGroup in (get groups of toolbar 1 of window "Global" of application process "Capture One 11") ... end repeat end tell
But I get an error when there's more then one Space and that application's window is in different Space then Script Editor:
error "Error in System Events : Impossible to get window \"Global\" of application process \"Capture One 11\"." number -1728 from window "Global" of application process "Capture One 11"
I've read that Spaces are not scriptable, so I wonder what could be the solution?
1The Spaces that you can define in Mission Control, which create some kind of virtual desktops.