No internet connection
  1. Home
  2. Support

Getting an error when trying to change the input on multiple selected tracks.

By Mike Wax @mikewax
    2020-11-26 01:26:59.930Z

    Desired Workflow

    I'm not sure why it isn't working based on the error log. It's telling me it couldn'tt fetch the mouse position.

    Question

    What does this error mean? Not sure how to fix it. I create multiple new tracks and want all of them to be changed to the same input.

    Thank you!

    Command Info

    ID: user:default:ckhwo9a7i00029r10xmtowu5u
    Name: Add new IVR Tracks
    

    Source

    
    sf.ui.proTools.appActivate();
    sf.ui.proTools.appWaitForActive();
    
    sf.ui.proTools.menuClick({
        menuPath: ["Track", "New..."],
    });
    
    sf.ui.proTools.windows.whoseTitle.is('New Tracks').first.elementWaitFor();
    
    sf.ui.proTools.windows.whoseTitle.is('New Tracks').first.textFields.whoseTitle.is('Track Name').first.elementSetTextFieldWithAreaValue({
        value: "IVR",
    });
    
    var ivrCount = prompt("How many tracks do you need?");
    
    const win = sf.ui.proTools.windows.whoseTitle.is('New Tracks').first;
    const numberField = win.textFields.whoseTitle.is('Number of new tracks').first;
    
    const numberOfTracks = ivrCount;
    
    if (numberField.value.invalidate().value.trim() !== numberOfTracks) {
        numberField.elementClick();
    
        sf.keyboard.type({ text: numberOfTracks });
    
        var i = 0;
        while (numberField.value.invalidate().value !== numberOfTracks) {
            sf.wait({ intervalMs: 50 });
        };
    }
    
    sf.ui.proTools.focusedWindow.getFirstWithTitle("Create").elementClick();
    
    sf.wait({
        intervalMs: 1000,
    });
    
    sf.ui.proTools.selectedTrack.trackInputSelect({
        inputPath: ["SM7B (Mono)"],
        selectForAllSelectedTracks: true,
    });
    
    

    Links

    User UID: HpKeItbsbJg4ClzkyDuBUiDd8mm2

    Feedback Key: sffeedback:HpKeItbsbJg4ClzkyDuBUiDd8mm2:-MN19HF-q7LnRSX6QeE_

    Feedback ZIP

    • 14 replies
    1. Hi Mike,

      Did you and Kitch already fix this here?

      1. Mike Wax @mikewax
          2020-11-26 02:23:01.643Z

          Yes, we sure did! Sorry for bombarding you guys with constant issues, LOL.

          I'm building on this script and creating more problems...as you can see.

          1. No worries :) Happy that you got it working!

            1. Mike Wax @mikewax
                2020-11-26 03:08:26.743Z

                My apologies, but the end of the script is what I was asking about. That part is new and getting errors. Sorry for the confusion.

                Trying to get multiple tracks to be the same input and it’s throwing an error. I included my log file.

                Again, my apologies for the confusion.

                Thank you for the help!

                1. Two things:

                  After having created a new track, and before accessing selectedTrack, make sure to invalidate the track cache, like this:

                  sf.ui.proTools.mainWindow.invalidate();
                  

                  Secondly, are you showing the I/O column on your tracks in the Edit window?

                  1. Mike Wax @mikewax
                      2020-11-26 23:42:09.173Z

                      Hey Christian,

                      I have ensured both things you mentioned are there, and still getting an error.

                      I added the track cache invalidation, and made sure my I/O is showing in my Edit Window.

                      I also tried adding the additional menu path, since i thought that could be an issue (interface -> SM7B (Mono)).

                      Here is the updated code (just the end part)

                      // invalidate the track cache
                      sf.ui.proTools.mainWindow.invalidate();
                      
                      sf.ui.proTools.selectedTrack.trackInputSelect({
                          inputPath: ["interface", "SM7B (Mono)"],
                          selectForAllSelectedTracks: true,
                      });
                      

                      Here's the error log:

                      1. Hm. Your code looks correct now. You do need the "interface" part as well.
                        If you open the menu in PT with option+shift held down, does it still show you the same options?

                        1. Mike Wax @mikewax
                            2020-11-27 18:53:49.938Z

                            It doesn't look like shift+opt changes anything on the menu options.

                            1. Mike Wax @mikewax
                                2020-11-27 18:55:32.805Z

                                It is working when i set it to "no input"

                                1. Hey Mike!

                                  This is a bit silly, but the fix is to actually add four empty spaces for any mono input or bus, like so:

                                  sf.ui.proTools.selectedTrack.trackInputSelect({
                                      inputPath: ["interface", "    SM7B (Mono)"],
                                      selectForAllSelectedTracks: true,
                                  });
                                  1. Mike Wax @mikewax
                                      2020-11-27 22:20:58.514Z

                                      HAHAHAHA, it worked!!!!

                                      What a weird thing. Do you know why that happens?
                                      Is it the same for Stereo tracks?
                                      How did you happen to figure that out?

                                      Thank you so much for sharing this!!!

                                      1. It is weird! It happens because Pro Tools is displaying the string like that.
                                        The stereo paths are going to be fine, it's just whenever we're dealing with mono paths.

                                        I figured it out while trying to access the mono outputs for a script and was having the same problem you were. If you look at the screenshot below, notice how the mono outs are tabbed in? I just started adding space at the beginning of the name in the script and 4 was the magic number lol

                                        It just so happens this behavior is also reflected on input paths, even though they don't look like they have spaces at the beginning.

                                        Glad I could help!

                                        1. Mike Wax @mikewax
                                            2020-11-27 22:42:58.709Z

                                            So the inputs just carry over the same formatting as they do in the stereo indentation. Really good catch!!!

                                            Thank you again for the help!!

                    • J
                      In reply tomikewax:
                      JP Aceto @JP_Aceto
                        2022-04-06 18:27:20.250Z

                        I added the bit of code to the end of an add vocal track macro and it worked for a few times then just stopeed working. Im EXTREMELY new at this so apologees of I seem ignorant to some things said or explained

                        1. Progress
                          with handling this problem
                        2. @chrscheuer marked this topic as Done 2020-11-26 02:50:19.306Z.