I have to say that the behaviour is exactly what I’d expect: selected is a property of the workspace on the primary machine, so the script acts on that. From a very brief play, I can’t change the selection on the remote machine so it makes perfect sense that scripts will act on the selection I can actually make, ie: that on the primary.
To be very clear, I had two workspaces open on the remote and connected the primary to one of them, whilst also having a template running on the primary to give me access to the hotkey script. I had different cues selected on the primary and the remote. Running the script from primary, the cue selected on primary was grouped. Running the script on the remote (from a local hotkey there), the cue selected locally was grouped. The two background workspaces were reassuringly untouched.
However, it was not without bugs: I’ve attached screenshots of the state of the workspace as seen from primary and on the remote after grouping a couple of cues like this. On the primary, it looks correct with 7 cues – I started with 5 then ran the script on two of them. On the remote, the cues that have been moved have disappeared, so only 5 cues left… It is disconcerting to be supposedly looking at the same workspace from two computers simultaneously and have them show different contents…! Even worse, once saved and reopened the cues primary could see but remote could not were gone for good from the workspace…
It’s going to take me several weeks to retest and rewrite everything for v5; I suppose I’m going to have to test everything against remote workspaces too… Crikey.
Rich