Marco wrote:I hope I'm wrong, but being XY single-threaded I fear that there's no way for a SC command to work while there's another script running.
Based on how Don fixed
this bug it seems it is possible for two scripts to be "running" at once. Of course, maybe one has to be stopped for it to work.
To be honest, I cannot say I'm totally comfortable with having multiple scripts running concurrently given that the majority of scripts rely on assumptions and knowing XY's current state. They're tied to the UI a bit too much for me.
One wish I've had for a while now but haven't fully fleshed out or formally made is a way to mark script files as trusted, which would let XY ignore Stepping Mode if enabled and just run the script. Maybe it makes sense to expand this to include a bit of a permissions model. (ie. Allow this script to run in background, without stepping, download/load resources from the Internet.) Something to consider while I wait for a good time to spring this on Don.
On the actual issue...
highend wrote:a variable that could be displayed in the title bar...
Changing the titlebar seems the most promising. Considering that scripts really aren't meant to run in the background, I'd say it would make a lot of sense for XY to append " - Running Script..." to the title bar when one is running. This could even be taken a step further to include the initial script's caption/file.
You could technically get close to this today (abuse aliases, <get alias titlebar>, goto('@titlebar=running');) but you have to trigger a refresh of the titlebar which I think only happens on location changes. Plus you have the problem of resetting it when the script is cancelled, stopped, or ends unexpectedly.
Some other possibilities:
Perhaps a lock file could be created whenever a script is running and removed when it isn't? Again, technically you could do that yourself by adjusting/wrapping your scripts, but you still have the problem of reliably unlocking.
Not sure what you're working on, but maybe you would be fine with the assumption that if the computer is idle then a script probably isn't running?