So I’d like to modify my “write automation to selection + confirmation dialogue” command with a little script beforehand that looks to see if pro tools is currently in playback, and if it is, waits to invoke this command until the transport is stopped. Is that possible?
- Christian Scheuer @chrscheuer2019-07-16 22:58:20.777Z
Hi @SeanH
You can do it like this:
function waitUntilPlaybackStopped() { while (sf.ui.proTools.isPlaying) { sf.engine.checkForCancellation(); sf.wait({ intervalMs: 100, }); } } waitUntilPlaybackStopped(); log('Playback is now stopped! Do your thing');
Tested with 3.0 preview 93 and PT 2019.6
- GIn reply toSeanH⬆:Graham Archer @Graham_Archer
Hey, this is really cool. I think it could be useful for an auto talkback. Can I ask what trigger did you use to have it running constantly? I tried:
type Application Trigger, When these apps Pro Tools, Event Activate
but it only seems to work when I switch apps and put Pro Tools in focus. I'd like to just have it running all the time if possible.
Christian Scheuer @chrscheuer2019-09-18 08:49:37.705Z
Hi @Graham_Archer.
Sorry if I wasn't clear in the example code. This was not designed to run constantly, but will just run once.
I've made a new thread for us to discuss running a command whenever PT transport is stopped:
https://forum.soundflow.org/-1017/how-to-trigger-a-command-whenever-pro-tools-transport-is-stopped