No internet connection
  1. Home
  2. How to

How to pause/wait in a script

a macro that would pause execution for a user defined time would be nice.
Currently when building macros, the execution is so fast that some programmed keypresses do not register. I'd love the ability to insert a short pause within a macro string

For example, the AVID Control app you can insert a pause by using a string of commas in a macro string.

Solved in post #4, click to view
  • 9 replies
  1. Hi Chris.

    You can use the "Wait" action to let your script wait for a specified number of milliseconds.

    However - with SoundFlow you very, very rarely if ever need to use manual wait times. And you should only use keyboard simulation sparingly. Part of what makes SoundFlow great in its integration with Pro Tools is that you can use UI automation to do the same tasks much more accurately, which means there's no need to add manual waits.
    Instead in SF we add waits for the actual elements/conditions to change.

    Please make sure to see these two videos for a crash course on how to go from simulating keyboard&mouse to doing UI automation:

    1. In reply toChris_Shaw:

      Thanks for the videos.
      I don't have the Wait or Wait For UI macros in my installation. I noticed a "Basic" folder in the video which also is not in my installation.
      Have they been removed or did I miss a step when installing SF?

      Again, apologies for the noob questions.

      1. Hi Chris.
        To add a "Wait" action to your macro, follow these steps:

        • First, start building your Macro.
        • To create a new Macro, click the "+ New" button and choose Macro:
        • Then give the Macro a name:
        • Now, over to the right is where you add Actions to your Macro. Click the "Add Action" button:
        • On the left side of your SoundFlow window, you'll now see a popup titled "Select action to add":
        • Type "Wait" and let it search for you:
        • Now click the "Wait" action in the right column:
        • Over on the right, you've now successfully added a "Wait" action to your macro:
        ReplySolution
        1. Obviously, having a macro that doesn't do anything but wait isn't super useful - so you would combine this with having other actions in your Macro.

          1. 🤦‍♂️🤦‍♂️🤦‍♂️🤦‍♂️
            Ugh. I'm an idiot.
            I'm confusing the package list with the actions search.
            My SINCEREST apologies for being a dumbass.

            1. No need to apologize :) Happy it makes sense now!

              1. AAndy Daddario @Andy_Daddario
                  2020-09-06 14:42:24.401Z

                  Hi Christian,

                  Trying to use "Wait" to do what I thought is the right series of commands. Basically all I'm trying to do is have the Transport roll for 2 seconds, and then hit the space bar again and stop. This is what I'm using below, but doesn't seem to be consistently working for some reason.

                  I've been reading I guess I should do this through UI commands and not Keyboard, but still total newbie here.

                  Thoughts on it?

                  Thanks!........Andy D.

                  sf.keyboard.press({
                  keys: "space",
                  });

                  sf.wait({
                  intervalMs: 2000,
                  });

                  sf.keyboard.press({
                  keys: "space",
                  });

                  1. Hi Andy,

                    I walk through how to use UI automation instead of keyboard in the 2 last videos in the Learning Soundflow playlist here:
                    https://www.youtube.com/playlist?list=PLKWpZOwx5Z3jxnpNo_dQPhDQNRwp7DCNj

                    1. AAndy Daddario @Andy_Daddario
                        2020-09-06 15:29:33.706Z

                        Hi Christian, ok cool I will check them out.

                        Thanks!......Andy