No internet connection
  1. Home
  2. How to

Help setting track output

By Drew Jurecka @Drew_Jurecka
    2021-09-26 20:42:45.389Z

    Hi there,
    Just trying to make a simple macro to create a click track and send it to my preferred output pair.
    Can anyone tell me why this isn't working?

    sf.ui.proTools.menuClick({
    menuPath: ["Track", "Create Click Track"],
    });

    sf.ui.proTools.selectedTrack.trackOutputSelect({
    outputPath: ["output", "CP 17-18 (Stereo)"],
    });

    I'm also attaching a picture of the track output menu with the desired track selected "CP 17-18 (Stereo) -> MTRX 9-10"

    Any help would be appreciated!

    Solved in post #8, click to view
    • 9 replies
    1. Hey Drew,

      You just have to complete the entire name of the output, like so:

      sf.ui.proTools.selectedTrack.trackOutputSelect({
          outputPath: ["output", "CP 17-18 (Stereo) -> MTRX 9-10"],
      });
      1. DDrew Jurecka @Drew_Jurecka
          2021-09-26 23:14:00.627Z

          Hi Raphael,
          Thanks for your response.
          This is what I tried initially and it didn't work. I just tried it again and I'm afraid it still throws up an error.

          1. Mmmm.. that's weird. Try this approach:

            sf.ui.proTools.selectedTrack.groups.whoseTitle.is("Audio IO").first.popupButtons.allItems[1].popupMenuSelect({
                menuPath: ["output", "CP 17-18 (Stereo) -> MTRX 9-10"]
            });
            
            1. DDrew Jurecka @Drew_Jurecka
                2021-09-27 05:10:30.774Z

                that doesn't work either. Very weird.

                Here's the error that comes up:

                << Command: Click Track w Default Outs [user:ckpxmxj6l0000pt10mszpvhzm:cku1mcu4c00026m102tbf28sw]

                27.09.2021 01:08:44.81 [Backend]: #Key: f13 (105) -> Click Track w Default Outs [cku1mdbpp00036m1011mr6t2w]
                Validating command... user:ckpxmxj6l0000pt10mszpvhzm:cku1mcu4c00026m102tbf28sw
                Invoking command...user:ckpxmxj6l0000pt10mszpvhzm:cku1mcu4c00026m102tbf28sw

                27.09.2021 01:08:44.81 [Backend]: >> Command: Click Track w Default Outs [user:ckpxmxj6l0000pt10mszpvhzm:cku1mcu4c00026m102tbf28sw]

                27.09.2021 01:08:45.25 [Backend]: AXUIElementException in LoadUIElement: kAXErrorInvalidUIElement
                Logging error in action (01) TrackSelectOutputAction: Could not find selected track's output button

                27.09.2021 01:08:45.25 [Backend]: !! Command Error: Click Track w Default Outs [user:ckpxmxj6l0000pt10mszpvhzm:cku1mcu4c00026m102tbf28sw]:
                Could not find selected track's output button (Click Track w Default Outs: Line 13)
                SoundFlow.Shortcuts.AXUIElementException: kAXErrorInvalidUIElement
                at SoundFlow.Shortcuts.AXUIElement.GetSubElements(String, Int32) + 0x1a7
                at SoundFlow.Shortcuts.AXUIElement.GetElementByTitle(String) + 0x4e
                at SoundFlow.Shortcuts.Ax.AxNodes.AxPtTrackOutputPathButton.GetIO(AXUIElement) + 0x20
                at SoundFlow.Shortcuts.Ax.AxNodes.AxPtTrackOutputPathButton.GetUIElement() + 0x48
                at SoundFlow.Shortcuts.Ax.AxNodes.AxElement.LoadUIElement() + 0x27 (AxPtTrackOutputPathButton)

                << Command: Click Track w Default Outs [user:ckpxmxj6l0000pt10mszpvhzm:cku1mcu4c00026m102tbf28sw]

          2. D
            In reply toDrew_Jurecka:
            Drew Jurecka @Drew_Jurecka
              2021-09-27 05:20:15.334Z

              Just one addition - I JUST tried this script and it worked. Once. With the original language
              sf.ui.proTools.selectedTrack.trackOutputSelect({
              outputPath: ["output", "CP 17-18 (Stereo) -> MTRX 9-10"],
              });

              And then it stopped working again. Can't get it to happen a second time.
              Kinda makes it seem like an issue with how SOundFlow is interacting with ProTools...

              1. D
                In reply toDrew_Jurecka:
                Drew Jurecka @Drew_Jurecka
                  2021-09-27 05:26:45.236Z

                  @raphaelsepulveda
                  One more update, as I troubleshoot this further:

                  If I restart SoundFlow and then run this command immediately, it will work one time. Then not at all. Same with a system restart. Works once and then never again.

                  Obviously the script CAN work since it will execute sometimes, which makes it seem like a bug with SoundFlow...

                  1. Ahh, good find! Sounds like it's in need of invalidation.

                    Try placing the following line before the code that sets the output:

                    sf.ui.proTools.mainWindow.invalidate();
                    ReplySolution
                    1. DDrew Jurecka @Drew_Jurecka
                        2021-09-27 06:15:34.101Z

                        That got it! Thanks!
                        Out of curiosity, what does 'invalidation' do? Is it something I should be trying in other problematic scripts?

                        1. Awesome!

                          Invalidating basically refreshes SoundFlow’s data cache. SoundFlow deals with this automatically pretty well but sometimes we have to help it.

                          In this case, SoundFlow’s awareness of the tracks in the session is not getting refreshed after the new click track is created. That’s why we invalidate the mainWindow, to get a current snapshot of the data present in it.

                          If you’d like to learn more, here’s an awesome post Christian wrote about it: When to use invalidate() #post-2