Inactive and Reactive plugin
How would one go about Inactivating plugin on insert 1, wait for it to inactivate, and then re-activate it again?
Why i need this:
I use EQ3 in preview mode whilst listening sweeping the EQ bands, and this often promps a bug in pro tools, which inables one to move several bands, and so you have to inactivate the plugin, and then reactivate it in order to make it function again / for some reason Avid have choosen not fix the bug, ever..
- samuel henriques @samuel_henriques
Hello @Emil_Woxen,
try this,
sf.ui.proTools.appActivateMainWindow(); const insertA = sf.ui.proTools.selectedTrack.groups.whoseTitle.is('Inserts A-E').first.buttons.whoseTitle.is('Insert Assignment A').first insertA.popupMenuSelect({ isRightClick: true, menuPath: ["Make Inactive"], targetValue: "Enable", }); insertA.popupMenuSelect({ isRightClick: true, menuPath: ["Make Active"], targetValue: "Enable", });
samuel henriques @samuel_henriques
this one is faster, but could be less stable
const insertA = sf.ui.proTools.selectedTrack.groups.whoseTitle.is('Inserts A-E').first.buttons.whoseTitle.is('Insert Assignment A').first.mouseClickElement({ isCommand:true, isControl:true, clickCount:2 })
- In reply tosamuel_henriques⬆:EEmil Woxen @Emil_Woxen
It's perfect! Thank you so much!
Stupid bug has been hunting me for years, and it seems like they're never gonna fix it..
- DIn reply toEmil_Woxen⬆:Dean Landon @Dean
Hi Samuel,
I tested your first script and it successfully deactivated and activated all 10 plugins on my inserts. I copied lines 3 to 9 ten times, updating each to target the appropriate inserts from A through J.
The issue I'm running into is that not all of my Pro Tools sessions have exactly 10 plugins on the inserts—each session varies. When that happens, SoundFlow throws an error.
Is there a way to modify the script so it dynamically adjusts based on how many plugins are present, and only tries to activate or deactivate the ones that exist?
Thanks so much!
Chad Wahlbrink @Chad2025-05-19 16:46:04.714Z
Hi, @Dean,
This should do the trick for you:
if (!sf.ui.proTools.isRunning) throw `Pro Tools is not running`; sf.ui.proTools.appActivateMainWindow(); sf.ui.proTools.mainWindow.invalidate(); /** * Activate or Deactivate Inserts * @param {'Activate'|'Deactivate'} activateOrDeactivate */ function activateOrdeactivateActiveInserts(activateOrDeactivate) { let inserts; if (activateOrDeactivate == 'Deactivate') { // Array of Active Inserts - Inserts are active when value is "" or "open", otherwise "inactive", "inactive and open", "unassigned" inserts = sf.ui.proTools.selectedTrack.invalidate().insertSelectorButtons.filter(x => x.value.value == "" || x.value.value == "open").map(x => x.title.value).map(x => x.slice(-1)); } else if (activateOrDeactivate == 'Activate') { // Array of Active Inserts - Inserts are active when value is "" or "open", otherwise "inactive", "inactive and open", "unassigned" inserts = sf.ui.proTools.selectedTrack.invalidate().insertSelectorButtons.filter(x => x.value.value == "inactive" || x.value.value == "inactive and open" ).map(x => x.title.value).map(x => x.slice(-1)); } // Filter Insert Buttons by Active Inserts let insertButtons = sf.ui.proTools.selectedTrack.invalidate().insertButtons.filter(insert => inserts.includes(insert.title.value.slice(-1))); // Deactivate each Active Insert insertButtons.forEach(i => i.mouseClickElement({ isControl: true, isCommand: true })) } activateOrdeactivateActiveInserts('Deactivate'); activateOrdeactivateActiveInserts('Activate');
- DIn reply toEmil_Woxen⬆:Dean Landon @Dean
Hi Chad,
Thanks for the information. I appreciate it.
Last night, my brother and I experimented with this command, and it worked. This is the activate command, and I have a similar deactivate command.
Should I include your command above or below mine, or is your command sufficient?
Thanks again!
sf.ui.proTools.appActivateMainWindow();
const insertA = sf.ui.proTools.selectedTrack.groups.whoseTitle.is('Inserts A-E').first.buttons.whoseTitle.is('Insert Assignment A').first
insertA.popupMenuSelect({
isRightClick: true,
menuPath: ["Make Active"],
targetValue: "Enable",
});
const insertB = sf.ui.proTools.selectedTrack.groups.whoseTitle.is('Inserts A-E').first.buttons.whoseTitle.is('Insert Assignment B').firstinsertB.popupMenuSelect({
isRightClick: true,
menuPath: ["Make Active"],
targetValue: "Enable",
});
const insertC = sf.ui.proTools.selectedTrack.groups.whoseTitle.is('Inserts A-E').first.buttons.whoseTitle.is('Insert Assignment C').firstinsertC.popupMenuSelect({
isRightClick: true,
menuPath: ["Make Active"],
targetValue: "Enable",
});
const insertD = sf.ui.proTools.selectedTrack.groups.whoseTitle.is('Inserts A-E').first.buttons.whoseTitle.is('Insert Assignment D').firstinsertD.popupMenuSelect({
isRightClick: true,
menuPath: ["Make Active"],
targetValue: "Enable",
});
const insertE = sf.ui.proTools.selectedTrack.groups.whoseTitle.is('Inserts A-E').first.buttons.whoseTitle.is('Insert Assignment E').firstinsertE.popupMenuSelect({
isRightClick: true,
menuPath: ["Make Active"],
targetValue: "Enable",
});
const insertF = sf.ui.proTools.selectedTrack.groups.whoseTitle.is('Inserts F-J').first.buttons.whoseTitle.is('Insert Assignment F').firstinsertF.popupMenuSelect({
isRightClick: true,
menuPath: ["Make Active"],
targetValue: "Enable",
});
const insertG = sf.ui.proTools.selectedTrack.groups.whoseTitle.is('Inserts F-J').first.buttons.whoseTitle.is('Insert Assignment G').firstinsertG.popupMenuSelect({
isRightClick: true,
menuPath: ["Make Active"],
targetValue: "Enable",
});
const insertH = sf.ui.proTools.selectedTrack.groups.whoseTitle.is('Inserts F-J').first.buttons.whoseTitle.is('Insert Assignment H').firstinsertH.popupMenuSelect({
isRightClick: true,
menuPath: ["Make Active"],
targetValue: "Enable",
});
const insertI = sf.ui.proTools.selectedTrack.groups.whoseTitle.is('Inserts F-J').first.buttons.whoseTitle.is('Insert Assignment I').firstinsertI.popupMenuSelect({
isRightClick: true,
menuPath: ["Make Active"],
targetValue: "Enable",
});
const insertJ = sf.ui.proTools.selectedTrack.groups.whoseTitle.is('Inserts F-J').first.buttons.whoseTitle.is('Insert Assignment J').firstinsertJ.popupMenuSelect({
isRightClick: true,
menuPath: ["Make Active"],
targetValue: "Enable",
});Chad Wahlbrink @Chad2025-05-19 18:18:24.572Z
Your script would work if the inserts were in all 10 slots. However, it would fail if any of those slots were missing inserts.
For sharing code in the forum, view this tutorial:
How to quote code in the SoundFlow forum.
- DIn reply toEmil_Woxen⬆:Dean Landon @Dean
Hey Chad,
I tried your command, and it activates immediately after it deactivates.
Could you please guide me on how to create one or the other? I’m quite new to this. :)
Thanks a lot!
Chad Wahlbrink @Chad2025-05-19 18:14:48.432Z
Hi, @Dean,
You can control this via the line with:
activateOrdeactivateActiveInserts('Activate');
Line 28 in this script:
if (!sf.ui.proTools.isRunning) throw `Pro Tools is not running`; sf.ui.proTools.appActivateMainWindow(); sf.ui.proTools.mainWindow.invalidate(); /** * Activate or Deactivate Inserts * @param {'Activate'|'Deactivate'} activateOrDeactivate */ function activateOrdeactivateActiveInserts(activateOrDeactivate) { let inserts; if (activateOrDeactivate == 'Deactivate') { // Array of Active Inserts - Inserts are active when value is "" or "open", otherwise "inactive", "inactive and open", "unassigned" inserts = sf.ui.proTools.selectedTrack.invalidate().insertSelectorButtons.filter(x => x.value.value == "" || x.value.value == "open").map(x => x.title.value).map(x => x.slice(-1)); } else if (activateOrDeactivate == 'Activate') { // Array of Active Inserts - Inserts are active when value is "" or "open", otherwise "inactive", "inactive and open", "unassigned" inserts = sf.ui.proTools.selectedTrack.invalidate().insertSelectorButtons.filter(x => x.value.value == "inactive" || x.value.value == "inactive and open" ).map(x => x.title.value).map(x => x.slice(-1)); } // Filter Insert Buttons by Active Inserts let insertButtons = sf.ui.proTools.selectedTrack.invalidate().insertButtons.filter(insert => inserts.includes(insert.title.value.slice(-1))); // Deactivate each Active Insert insertButtons.forEach(i => i.mouseClickElement({ isControl: true, isCommand: true })) } activateOrdeactivateActiveInserts('Activate');
Chad Wahlbrink @Chad2025-05-19 18:15:19.687Z
@Dean, for deactivate, you would just change line 28 to:
activateOrdeactivateActiveInserts('Deactivate');
- DIn reply toEmil_Woxen⬆:Dean Landon @Dean
Hi Chad, thanks again for the help.
When I "Activate" the 5 plugins on the inserts, I get this failed message. Am I missing something?
Thanks again!
Chad Wahlbrink @Chad2025-05-19 21:49:45.526Z
Hi, @Dean,
Are you saying it fails when you use the script to activate five inserts?
The only thing I will note is that this specific script does not play well if the tracks are set to "mini" or "micro." Otherwise, this script seems to work as expected for me.
It might be best to ask this question using the "Script or Macro Help Workflow":
https://soundflow.org/docs/help#script-helpThis would allow me to make sure we are using the same code and there isn't a system-specific error happening. This short video explains how to ask for help and upload information in this way:
https://youtu.be/H3eeKvUIx7gThanks, Dean.
- DIn reply toEmil_Woxen⬆:Dean Landon @Dean
Hi Chad,
I never use Mini or Micro. Most of my Instr tracks are Small, but this particular track is always Medium.
I'll post my question where you suggested.
Thanks again!
- D
Chad Wahlbrink @Chad2025-05-20 14:43:32.267Z
Posting here for anyone who is curious, more stable code for this is here: