No internet connection
  1. Home
  2. How to

How to make commands wait to trigger until pro tools transport is stopped

By Sean @SeanH
    2019-07-16 21:44:28.590Z

    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?

    Solved in post #2, click to view
    • 3 replies
    1. 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

      Reply1 LikeSolution
      1. G
        In reply toSeanH:
        Graham Archer @Graham_Archer
          2019-09-18 08:42:24.225Z

          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.

          1. 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