This script shows how to fully automate Audio Suite plugins - opening, setting options, selecting presets, rendering, and closing windows again.
- Christian Scheuer @chrscheuer2018-06-15 19:10:31.971Z
//Open the plugin and save the plugin window to the "asWin" variable var asWin = sf.ui.proTools.audioSuiteOpenPlugin({ category: 'Reverb', name: "Altiverb 7 (Stereo)" }).window; //Set processing options asWin.audioSuiteSetOptions({ processingInputMode: "EntireSelection", processingOutputMode: "CreateContinuousFile" }); //Select your preset asWin.audioSuiteSelectPreset({ presetMenuPath: ["CMS Notre Dame"] }); //Render asWin.audioSuiteRender(); //Close the window asWin.windowClose();
Christian Scheuer @chrscheuer2019-02-08 18:05:46.393Z
If you just need to open an audio-suite plugin, use this code:
sf.ui.proTools.audioSuiteOpenPlugin({ category: 'Reverb', name: "Altiverb 7 (Stereo)" });
- SStefan Holm @Stefan_Holm
but I get this every time I run the command.
Christian Scheuer @chrscheuer2019-10-11 08:54:20.937Z
Hi @Stefan_Holm.
Most likely the path provided to the preset you want to select is wrong. Can you show us a screenshot of the preset you're trying to select together with your specific code?
In the code above it tries to load my preset "CMS Notre Dame" which is located in the root of my settings popup. If your preset is called something else, you should rename the preset in the script accordingly - and if you don't want to load a particular preset at all, you can delete those lines that deal with the preset selection.- SStefan Holm @Stefan_Holm
yes it all makes sense, but I do have the Notre Dame preset and I have pasted the code above into the script manager. Now I have tried with another preset but still the same.
- SStefan Holm @Stefan_Holm
Christian Scheuer @chrscheuer2019-10-11 12:30:01.424Z
@Stefan_Holm can you show me a screenshot of your preset menu folded out?
- SStefan Holm @Stefan_Holm
everything works now . . just needed to create the preset my self. already made a lot of my own of this category and it works like a charm.
ThanksChristian Scheuer @chrscheuer2019-10-11 13:46:29.322Z
Awesome :)
Mike Wax @mikewax
I'm getting a similar issue where it seems as though it's not finding my preset. I have my present saved in the root folder. Here's my error:
Christian Scheuer @chrscheuer2022-05-28 12:27:04.919Z
Hi Mike
It's better to use bit.ly/sfscripthelp for getting help rather than reviving this old thread :)
- JIn reply tochrscheuer⬆:Jonathan Grossman @Jonathan_Grossman
I am using a piece of this script for NUGEN LM CORRECT2. It fails to close the window, I believe bc of the time it's taking to render the file. I have tried using the MACRO version with the WAIT function, even up tp 4000ms, but still doens't work.
Here's my code:
sf.ui.proTools.windows.whoseTitle.is('Audio Suite: NUGEN LMCorrect2').first.buttons.whoseTitle.is('Render').first.elementClick();
//Close the window
asWin.windowClose();Christian Scheuer @chrscheuer2020-04-30 20:04:06.566Z2020-04-30 21:07:08.702Z
Hi Jonathan - use
asWin.audioSuiteRender();
- it should take care of waiting correctly.- JJonathan Grossman @Jonathan_Grossman
Great - where do I put it in the code?
- JJonathan Grossman @Jonathan_Grossman
Is this the best way?
var asWin = sf.ui.proTools.audioSuiteOpenPlugin({
category: 'Sound Field',
name: "NUGEN LMCorrect2"
}).window;asWin.audioSuiteRender();
asWin.windowClose();
Christian Scheuer @chrscheuer2020-04-30 21:06:51.021Z
Yes :)
- JJonathan Grossman @Jonathan_Grossman
This is ALMOST perfect. But let's say i already have the AS window open and need to analyze for a different preset. I click the macro, it knows the window is already open, GREAT, but it switches to back to the default preset. Can I have it ignore preset assignment if the window is already open?
sf.ui.proTools.audioSuiteOpenPlugin({ category: "Sound Field", name: "NUGEN LMCorrect2", }); sf.ui.proTools.firstAudioSuiteWindow.audioSuiteSetOptions({ }); var asWin = sf.ui.proTools.getAudioSuiteWindow("NUGEN LMCorrect2"); if (!asWin.exists) { asWin = sf.ui.proTools.audioSuiteOpenPlugin({ category: "Sound Field", name: "NUGEN LMCorrect2", }).window; } //Click learn button asWin.getFirstWithTitleContaining("Analyze").elementClick()
Christian Scheuer @chrscheuer2020-05-07 14:02:33.858Z
I'm not 100% sure I follow - are you saying clicking Analyze/Learn makes it change preset? Or do you have other code that sets the preset that is not quoted here?
Or maybe it just resets the preset because you unconditionally open the plugin in your first call. If this latter guess is correct, then this should work:var asWin = sf.ui.proTools.getAudioSuiteWindow("NUGEN LMCorrect2"); if (!asWin.exists) { //AudioSuite window isn't open, so open it and do some other stuff asWin = sf.ui.proTools.audioSuiteOpenPlugin({ category: "Sound Field", name: "NUGEN LMCorrect2", }).window; //Set options sf.ui.proTools.firstAudioSuiteWindow.audioSuiteSetOptions({}); } //Click learn button asWin.getFirstWithTitleContaining("Analyze").elementClick();
- JJonathan Grossman @Jonathan_Grossman
I have one button for analyze that opens the window and analyzes the file. It also happens to automatically choose the user default preset.
I’d rather it just leave the current preset setting if the window is already open.
Ideally macro would also be smart enough to know that if I had already analyzed the file and hit the button again, it would render. Save me a button on the SD!
Christian Scheuer @chrscheuer2020-05-07 15:30:16.919Z
I'm not sure if we can safely read if Nugen has analyzed the file or not, currently. But we'll get some more image recognition tools in 3.8 or 3.9, so that might help.
Do you still need help with the script though? Nowhere in your code is there a call to set the preset, so either my assumption above was correct that your unconditional call to open the plugin effectively did choose the user default preset - or there's some part of your code we're not seeing.
- JJonathan Grossman @Jonathan_Grossman
Yes it is defaulting to the user preset upon opening. You’re correct. I’ll try the code you provided. Thanks as always Christian. You and the team are amazingly generous with your time and incredible coders to boot! One of the reasons I wanted to pay for additional help is bc I felt it was appropriate to reciprocate in some way for all the support you provide.