Hey Everyone.
With the help of the forum I've been able to assign a plugin to any MONO AUDIO track in Pro Tools with one click of a Stream Deck button, but I would like the same command to work on a STEREO or ANY track type (Inst) and number channels(Mono/Stereo/5.1 etc). Is this possible? Below is my script. I also used Chris Shaw's handy script for plugging into the next available insert no matter if you're on the mix or edit window!
function ensureFirstSelectedTrackIsVisible() {
var originallySelectedTrackNames = sf.ui.proTools.selectedTrackNames;
sf.ui.proTools.selectedTrack.trackScrollToView();
sf.ui.proTools.trackSelectByName({ names: originallySelectedTrackNames, deselectOthers: true });
}
if (sf.ui.proTools.getMenuItem('Window', 'Mix').isMenuChecked) {
var mainWindow = "Mix";
sf.ui.proTools.menuClick({
menuPath: ["Window", "Edit"],
});
ensureFirstSelectedTrackIsVisible();
} else {
mainWindow = "Edit";
ensureFirstSelectedTrackIsVisible();
}
function getFirstFreeInsertIndex() {
var btns = sf.ui.proTools.selectedTrack.invalidate().insertButtons;
for (var i = 0; i < 10; i++)
if (btns[i].value.invalidate().value === "unassigned") return i;
return -1;
}
sf.ui.proTools.selectedTrack.trackInsertOrSendSelect({
insertOrSend: 'Insert',
pluginNumber: getFirstFreeInsertIndex() + 1,
pluginPath: ['plug-in', 'EQ', 'UAD UA 610-B (mono)'],
selectForAllSelectedTracks: true,
});
sf.ui.proTools.appActivate();
sf.ui.proTools.invalidate();
switch (mainWindow) {
case "Mix":
sf.ui.proTools.menuClick({
menuPath: ["Window", "Mix"],
});
break;
case "Edit":
break;
}
- Chris Shaw @Chris_Shaw2020-10-17 21:43:57.704Z2020-10-17 22:33:38.625Z
If you have a moment could you quote the code in this post by adding 3 ticks (`) before and at the end of your code? It will make it much easier to read and help you out.
If you're sure not how, Kitch posted a video about it here:
https://forum.soundflow.org/-3038/how-to-quote-code-in-the-soundflow-forum - In reply toBergatron_Music⬆:Bergatron Music @Bergatron_Music
Hey Chris.
Thanks for the tip! I'm a total newb to Java so I really appreciate all the help. I'm really loving your Edit/Mix window script as you can see! Here's my script properly pasted. Cheers.function ensureFirstSelectedTrackIsVisible() { var originallySelectedTrackNames = sf.ui.proTools.selectedTrackNames; sf.ui.proTools.selectedTrack.trackScrollToView(); sf.ui.proTools.trackSelectByName({ names: originallySelectedTrackNames, deselectOthers: true }); } if (sf.ui.proTools.getMenuItem('Window', 'Mix').isMenuChecked) { var mainWindow = "Mix"; sf.ui.proTools.menuClick({ menuPath: ["Window", "Edit"], }); ensureFirstSelectedTrackIsVisible(); } else { mainWindow = "Edit"; ensureFirstSelectedTrackIsVisible(); } function getFirstFreeInsertIndex() { var btns = sf.ui.proTools.selectedTrack.invalidate().insertButtons; for (var i = 0; i < 10; i++) if (btns[i].value.invalidate().value === "unassigned") return i; return -1; } sf.ui.proTools.selectedTrack.trackInsertOrSendSelect({ insertOrSend: 'Insert', pluginNumber: getFirstFreeInsertIndex() + 1, pluginPath: ['plug-in', 'EQ', 'UAD UA 610-B (mono)'], selectForAllSelectedTracks: true, }); sf.ui.proTools.appActivate(); sf.ui.proTools.invalidate(); switch (mainWindow) { case "Mix": sf.ui.proTools.menuClick({ menuPath: ["Window", "Mix"], }); break; case "Edit": break; }
Chris Shaw @Chris_Shaw2020-10-17 22:36:49.843Z
This might take a couple of days. Hang tight.
- In reply toBergatron_Music⬆:Chris Shaw @Chris_Shaw2020-10-21 19:43:20.739Z
Here you go:
https://soundflow.org/store/insert-plugin-on-next-free-slot-intelligent
be sure to watch the video.//CS//
- CConrad Sanguineti @Conrad_Sanguineti
Hey Chris. Great script. I will be using it. But a small glitch. When I change desktops on my mac (ie web browser), and return to my Pro Tools desktop, the script will run. Pretty funny glitch
-Con
- CConrad Sanguineti @Conrad_Sanguineti
I disabled "When Pro Tools becomes active" trugger, and glitch is gone. Makes sense :)
- In reply toBergatron_Music⬆:Bergatron Music @Bergatron_Music
Thank you Chris! I'll watch now.
Cheers.
-Brian - In reply toBergatron_Music⬆:Bergatron Music @Bergatron_Music
This is insane Chris!
Works awesome! You've simplified it so much. I really appreciate it. Thank you!
-Brian