Getting an error when trying to change the input on multiple selected tracks.
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_
Linked from:
Christian Scheuer @chrscheuer2020-11-26 02:09:07.230ZHi Mike,
Did you and Kitch already fix this here?
Mike Wax @mikewaxYes, 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.
Christian Scheuer @chrscheuer2020-11-26 02:50:14.922ZNo worries :) Happy that you got it working!
Mike Wax @mikewaxMy 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!
Christian Scheuer @chrscheuer2020-11-26 09:51:34.156ZTwo 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?
Mike Wax @mikewaxHey 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:
Christian Scheuer @chrscheuer2020-11-27 11:25:20.420ZHm. 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?
Mike Wax @mikewaxIt doesn't look like shift+opt changes anything on the menu options.

Mike Wax @mikewaxIt is working when i set it to "no input"
Raphael Sepulveda @raphaelsepulveda2020-11-27 22:16:56.700ZHey 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, });
Mike Wax @mikewaxHAHAHAHA, 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!!!
Raphael Sepulveda @raphaelsepulveda2020-11-27 22:32:45.784ZIt 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!
Mike Wax @mikewaxSo the inputs just carry over the same formatting as they do in the stereo indentation. Really good catch!!!
Thank you again for the help!!
- JIn reply tomikewax⬆:JP Aceto @JP_Aceto
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
- Progresswith handling this problem