No internet connection
  1. Home
  2. How to

"Convert" open plug in (with current settings) to the corresponding Audiosuite plugin

By Robert Sörling @robertsorling
    2020-09-30 21:02:47.716Z

    I often find myself tweaking the settings of a plug-in and the decide to copy&paste the settings to the corresponding AudioSuite version. Is there a way to "convert" a plug-in via a macro or a script?

    Solved in post #5, click to view
    • 45 replies

    There are 45 replies. Estimated reading time: 27 minutes

    1. Yea.. I guess if there's a 1-to-1 relationship between the name of the insert plug-in and the AudioSuite version, then you could write a script/macro that automated this.
      The first step would be to write down a sequence of the actions you'd like it to take. The next step would be to try to get a macro to do most of these things (the only thing I think you can't do would be the matching of the names).

      1. In reply torobertsorling:

        Shift - cmd - C is the keystroke for copying plugin data. shift-cmd - v will paste it.
        If I have the time tomorrow I could whip this up pretty easily

        1. R
          In reply torobertsorling:
          Robert Sörling @robertsorling
            2020-10-01 09:18:32.603Z

            Ok, yes the part I can’t figure out is how to get the corresponding AudioSuite to open. The rest is pretty straight forward. Maybe it’s not possible but if anyone has any suggestions... :) Thanks!

            1. In reply torobertsorling:
              Chris Shaw @Chris_Shaw2020-10-01 20:44:47.345Z2024-06-14 16:03:11.562Z

              EDIT: THIS HAS BEEN REFACTORED / REWRITTEN !!!!
              SEE BELOW: "Convert" open plug in (with current settings) to the corresponding Audiosuite plugin #post-40
              Here you go. Thanks for asking for this. It's really useful!

              sf.ui.proTools.appActivate();
              
              // Declare variables
              let pluginName;
              let trackName;
              
              // Define pluginWindow and AS Setings menu
              const plugInWindow = sf.ui.proTools.windows.whoseTitle.contains('Plug-in:').first
              
              const asSettingsMenu = sf.ui.proTools.firstAudioSuiteWindow.popupButtons.whoseTitle.is('Settings Menu').first;
              
              // Check if a plugin window is open. If not, abort
              if (!plugInWindow.exists) {
                  sf.interaction.notify({
                      title: "Please Select an Active Plugin",
                  });
                  throw 0
              }
              
              // Ensure plug-in window is focused
              if (!plugInWindow.isFocused) plugInWindow.elementRaise();
              
              // Get plug-in window values
              pluginName = plugInWindow.popupButtons.whoseTitle.contains('Plug-In Selector')
                  .first.value.value;
              
              trackName = plugInWindow.popupButtons.whoseTitle.contains('Track Selector')
                  .first.value.value;
              
              sf.ui.proTools.trackGetByName({ name: trackName, makeVisible: true }).track.trackSelect();
              
              // Copy plugin sesttings
              const popupMenu = plugInWindow.popupButtons.whoseTitle.is('Settings menu')
                  .first;
              
              popupMenu.popupMenuSelect({
                  menuPath: ["Copy Settings"],
              });
              
              // Open Audiosuite menu, get all menu items and paths, and convert to array
              const asMenu = sf.ui.proTools.children.whoseRole.is("AXMenuBar").whoseTitle.is('').first.children.whoseRole.is
                  ("AXMenuBarItem").whoseTitle.is('AudioSuite').first;
              
              const asItems = asMenu.popupMenuFetchAllItems().menuItems.map(mi => mi.path.join());
              
              //// Search for •EXACT• plug-in / AS match ////////////
              
              // Search AS list and get index of path that contains the plugin name
              for (var i in asItems) {
                  var lastComma = asItems[i].lastIndexOf(",")
                  var path1 = asItems[i].slice(0, lastComma)
                  var path2 = asItems[i].slice(lastComma + 1)
                  if (path2 == pluginName) { break; }
              }
              
              // Check to see if all menu items have been parsed - if so, no exact match has been found.
              // sort through AS plugs for a LOOSE MATCH (Some AS have mono or stereo versions)
              if (parseInt(i) + 1 == asItems.length) {
              
                  // Get track width of selected track to append to plugin name for loose match search
                  var numberOfPanSliders = sf.ui.proTools.selectedTrack.groups.whoseTitle.is('Audio IO').first.sliders.whoseTitle.startsWith('Audio Pan indicator').count;
                  if (numberOfPanSliders == 1) {
                      var pathAddition = " Mono"
                  } else { pathAddition = " Stereo" }
              
                  sf.interaction.notify({
                      title: "Exact AS/Plug-in match not Found",
                      message: "Trying Loose Match For: " + pluginName + pathAddition,
                  })
              
                  let index
                  for (index = 0; asItems.length; index++) {
                      try {
                          var lastComma = asItems[index].lastIndexOf(",");
                      }
                      catch (error) {
                          sf.interaction.displayDialog({ prompt: "No AS version of plugin found ", })
                          throw 0
                      }
                      var path1 = asItems[index].slice(0, lastComma)
                      var path2 = asItems[index].slice(lastComma + 1)
                      if (path2.indexOf(pluginName + pathAddition) == 0) {
              
                          break;
                      }
                  }
              
                  // Open AS plug-in
                  sf.ui.proTools.audioSuiteOpenPlugin({
                      category: path1,
                      name: path2,
                  });
              
                  const asSettingsMenu = sf.ui.proTools.firstAudioSuiteWindow.popupButtons.whoseTitle.is('Settings Menu').first;
              
                  asSettingsMenu.popupMenuSelect({
                      menuPath: ["Paste Settings"],
                  });
                  sf.interaction.displayDialog({
                      prompt: "An •EXACT• match of the original plugin was not found. A best guess has been substituted." +
                          "\n\nPlease check that the proper Audiosuite version has been selected (check for correct settings: " +
                          "mono /stereo, etc) before processing.\n\n" +
                          "If you need to select another AS version you can still paste the settings using Shift - Cmd -V.",
                      defaultButton: "OK",
                  })
              
                  throw 0
              }
              
              // Open AS Plugin
              sf.ui.proTools.audioSuiteOpenPlugin({
                  category: path1,
                  name: path2,
              });
              
              // Paste Plug In Settings
              asSettingsMenu.invalidate().popupMenuSelect({
                  menuPath: ["Paste Settings"],
              });
              
              Reply1 LikeSolution
              1. RRobert Sörling @robertsorling
                  2020-10-01 21:00:56.893Z

                  THANK YOU!

                  1. It's pretty slick. I used to do this routine manually with RX plugins. Insert de-noise, tweak, then convert to AS and process.

                    Question, would you want to close the plugin after pasting the AS settings?
                    Should a dialog box appear to ask this?

                    1. RRobert Sörling @robertsorling
                        2020-10-01 23:05:41.591Z

                        I actually implemented this already so that it renders the selected clip and then closes the AS. This will save me alot of time. Again, thanks!

                        1. Hey Muzzle,

                          I had to modify the code. I discovered that if a plugin had a UAD version installed as well there would be an outside chance that it would pick the UAD Audiosuite version by accident.

                          I updated the code above.

                          //CS//

                          1. Really nice, Chris. Are you publishing this somewhere or should I include it in the "official" Pro Tools Utilities package with a reference to you?

                            1. Christian, I have a couple of issues with it at the moment (edge cases) where it picks the wrong plugin. I’d like to go over it with you if you have a moment.

                              1. In reply tochrscheuer:

                                Christian.

                                I think I've worked out the bugs in this 🙃. See my last post below.

                                I wasn't planning on publishing this so if you want to include it in the PT Utilities package with proper attribution that'd be fine.

                                1. I've refactored this quite a bit to utilize regex filtering. It's a bit more robust now.
                                  See below

                      • In reply toChris_Shaw:
                        TThomas Gloor @Thomas_Gloor
                          2024-06-14 06:09:51.308Z

                          Hey @Chris_Shaw !

                          Thank you for this! One little issue I ran into, and can't really figure out a way to get out of.

                          Your code doesn't seem to work if the AudioSuite is set as a favourite, meaning the appear on top of the category/manufacturer list.

                          The variable path1 returns the name of the plugin, with the last letter truncated.

                          Do you have an idea?

                          Thank you!

                          1. New script below should take care of this…

                            1. TThomas Gloor @Thomas_Gloor
                                2024-06-19 17:09:04.437Z

                                Thank you!

                          2. In reply torobertsorling:

                            OK.
                            I've edited much more robust version of the script and pasted it to the above script.
                            I noticed that there would be errors when converting Waves plugins to AS. Waves have 2 AS versions of each plugin (Ex. the F6 eq is listed as F6 Mono and F6 Stereo).

                            There was also other instances where the wrong AS version of a plugin would be selected. (Ex If the plugin selected was Vertigo VSC2 then UAD Vertigo VCS2 would be selected instead due to the way I was filtering the AS menu)

                            This script now looks for an exact match first and if there isn't one it assumes there is a stereo and mono AS version. It then detects if the track is mono or stereo and looks for "plug-in name + mono/stereo". If something is found this way it opens the AS and opens an alert prompting the user to double check that the right plugin has been chosen.

                            1. J
                              In reply torobertsorling:
                              Jon Lipman @Jon_Lipman
                                2022-07-25 17:18:30.009Z

                                Hi @Chris_Shaw I'm attempting this script but it's only saving the preset but not opening the corresponding audiosuite version - you said above that you fixed it and I used the large script posted above but no luck. any ideas?

                                1. Which plugin are you trying to convert to AS?
                                  Is the script working for other plugins?
                                  As a test, try converting the AVID 7-band eq to AS.

                                  1. JJon Lipman @Jon_Lipman
                                      2022-07-25 18:04:29.362Z

                                      Just tried it but no luck...same thing happened then a "please select active plugin" prompt came up - here's the log:

                                      25.07.2022 11:02:53.33 [Backend]: Logging error in action (01) WaitForPopupMenuAction: Popup window was not found after waiting 2000 ms
                                      Logging error in action (01) OpenPopupMenuFromElementAction: Popup menu was not found
                                      Logging error in action (01) PopupMenuSelectAction: Could not open popup menu

                                      25.07.2022 11:02:53.33 [Backend]: << Command: INSERT TO PLUGIN [user:ckz4kpwnr0005t2101rnyu5v1:cl610dzhk0000wl10huw7qyeb]

                                      1. I just updated the script above.
                                        Let me know if it works.

                                        1. In reply toJon_Lipman:

                                          Also, this script will not work if you trigger it from the SF editor.
                                          Be sure to assign it to a keyboard / StreamDeck trigger.
                                          PT must be the focused app when you run it.

                                    • J
                                      In reply torobertsorling:
                                      Jon Lipman @Jon_Lipman
                                        2022-07-25 20:28:09.238Z

                                        Unfortunately still no luck...Pro Tools is focused and I'm using a keyboard shortcut.

                                        I'm using the 7 band eq as suggested. It pops up, asks me to save preset and then gives me an error - log pasted below.

                                        Is the save preset dialogue expected behavior or should it go immediately into the audiosuite?

                                        << Command: CONVERSION [user:ckz4kpwnr0005t2101rnyu5v1:cl6175m5c0002wl10xwqaxlax]

                                        25.07.2022 13:25:47.41 [Backend]: #Key: ctrl+command+alt+5 (23) -> CONVERSION [cl6176ztg0004wl10g17imupz]

                                        25.07.2022 13:25:47.41 [Backend]: >> Command: CONVERSION [user:ckz4kpwnr0005t2101rnyu5v1:cl6175m5c0002wl10xwqaxlax]

                                        25.07.2022 13:25:47.42 [Backend]: Checking for running apps with bundle 'com.avid.ProTools'

                                        25.07.2022 13:25:47.42 [Backend]: NSArray.ArrayFromHandle count = 1

                                        25.07.2022 13:25:47.46 [Backend]: Early abort from trackSelect, since track was already selected

                                        25.07.2022 13:25:47.53 [Backend]: Mouse current pos is: (345, 274)
                                        Clicking with mouse here: (2953, 488)

                                        25.07.2022 13:25:47.53 [Backend]: Moving back...

                                        25.07.2022 13:25:47.54 [Backend]: Position is now: (345, 274)

                                        25.07.2022 13:25:47.77 [Backend]: [SF_FIREBASE_WS]: Sending keep-alive

                                        25.07.2022 13:25:49.95 [Backend]: Logging error in action (01) WaitForPopupMenuAction: Popup window was not found after waiting 2000 ms
                                        Logging error in action (01) OpenPopupMenuFromElementAction: Popup menu was not found

                                        25.07.2022 13:25:49.97 [Backend]: !! Command Error: CONVERSION [user:ckz4kpwnr0005t2101rnyu5v1:cl6175m5c0002wl10xwqaxlax]:
                                        Popup menu was not found (CONVERSION: Line 23)
                                        Popup window was not found after waiting 2000 ms

                                        1. Hi Jon,

                                          It may be easier to get help by using bit.ly/sfscripthelp as it will give the full log (and more info such as your SF version and PT version). Be sure to use SF 5.1.5 if you aren't already. You can then tag the relevant people and link to this thread in the thread that gets created using the script help feature.

                                          1. JJon Lipman @Jon_Lipman
                                              2022-07-26 17:03:13.485Z

                                              Ok cool - thanks I didn't know that was an option...will do

                                            • In reply toJon_Lipman:

                                              Hey @Jon_Lipman,
                                              I think I may have found the problem.
                                              I re-edited the code above.
                                              The script shouldn't be asking you to save settings so if you're still getting that behavior or it still in't working please file a bug as @chrscheuer described above.
                                              Thanks
                                              //CS//

                                              1. JJon Lipman @Jon_Lipman
                                                  2022-07-26 17:07:17.199Z

                                                  Thanks for your work on this but unfortunately still getting that save settings dialogue followed by a timeout...I'll submit a bug as suggested

                                                  1. Hmm, Found another possible bug. Try the edited script above.
                                                    Fingers crossed…

                                                    1. TTristan Hoogland @Tristan
                                                        2022-10-19 17:53:41.161Z

                                                        Hey Chris - firstly amazing script. I was about to deep dive into my own version of this, but naturally you've done all the hard work (and undoubtedly much more impressively than I could ever do).

                                                        Unfortunately I'm having issues getting it to work here - keep running into an error at line 44.

                                                        Popup menu was not found
                                                        Popup window was not found after waiting 2000 ms
                                                        

                                                        It just drops down the AudioSuite menu and that's where it ends. I can see you're cleverly using an array to get the match happening.

                                                        I haven't tried it on my studio computer yet, but on my laptop I'm on the newest ProTools 2022.9.

                                                        Thanks C!

                                                        1. A couple of questions:

                                                          • which plugin are you trying to convert to AS?
                                                          • what OS are you running
                                                          1. TTristan Hoogland @Tristan
                                                              2022-10-19 23:19:41.707Z

                                                              At this stage primarily Fabfilter Pro L2, but I also tried a single instance of Q3 as you had and that also resulted in the same behavior.

                                                              OS is Monterey 12.4

                                                  2. In reply torobertsorling:
                                                    Ben Rubin @Ben_Rubin
                                                      2023-03-30 22:48:08.945Z

                                                      hey @Chris_Shaw,

                                                      thanks so much for this amazing script. sadly, it is working with all plugins except RX, which is what I would most likely want to use.

                                                      I'm getting this error:
                                                      Object reference not set to an instance of an object. (CONVERT INSERT TO AUDIOSUITE: Line 111)
                                                      System.NullReferenceException: Object reference not set to an instance of an object.

                                                      Running Mac Os 12.6.2 and SF 5.3.2

                                                      thanks in advance.

                                                      (also, how can i get your jump the playhead forward or back a set amount script???)

                                                      1. Which version of RX are you running?
                                                        Where /When did I mention a jump back/forward set amount script?

                                                        1. Ben Rubin @Ben_Rubin
                                                            2023-03-31 01:56:30.925Z

                                                            I'm running RX 10.

                                                            You mentioned it on Recording Studio Rockstars, I believe.

                                                            1. In reply toChris_Shaw:
                                                              Ben Rubin @Ben_Rubin
                                                                2023-06-02 03:22:46.481Z

                                                                Hey @Chris_Shaw,

                                                                Doing a bit more research on this issue and I've discovered that it is certain plugins that are mis-reporting their category to SF. When I set a log for "path 1" I dont get something like "Dynamics," I get a version of the plugin name with the last character truncated. So "RX 10 De-clip" has it's category listed as "RX 10 De-cli".

                                                                In other cases I've tested the script works great.

                                                                The ones I've found to fail are:

                                                                Ozone 10 Master Rebalance
                                                                RX 10 De-clip
                                                                RX 10 De-click
                                                                RX 10 De-crackle
                                                                RX 10 De-hum
                                                                RX 10 De-plosive
                                                                RX 10 Guitar De-noise
                                                                RX 10 Spectral De-noise

                                                                Also Waves Soundshifter Pitch fails after it tries to find a loose version of the name.

                                                                I hope this helps refine the script.

                                                                1. Ben Rubin @Ben_Rubin
                                                                    2023-06-13 23:03:34.153Z2023-08-07 13:41:57.042Z

                                                                    hi again @Chris_Shaw, just trying you again re the above scripts. if you have the time, much appreciated. if not, also much appreciated.

                                                                    1. Ben Rubin @Ben_Rubin
                                                                        2023-11-09 15:48:11.398Z

                                                                        hey @Chris_Shaw, I know you're a busy guy, but hoping you can address the quirks of audiosuite that I mention above. thanks in advance!

                                                                        1. sorry for the long delay - new script below

                                                                  • In reply toBen_Rubin:
                                                                  • M
                                                                    In reply torobertsorling:
                                                                    Martin Pavey @Martin_Pavey
                                                                      2023-06-06 17:33:42.686Z

                                                                      Wow!
                                                                      This script is very cool, I will be using it a lot.
                                                                      Thanks Chris & Robert!

                                                                      1. In reply torobertsorling:
                                                                        Chris Shaw @Chris_Shaw2024-06-14 16:00:05.632Z2024-06-14 17:48:59.159Z

                                                                        Hey guys - I've refactored this script to make it more robust.
                                                                        It grabs the name and path from the plugin selector popup in the plugin window and then uses regex to make a path for selecting the AS plug-in.

                                                                        I'm leaving the original above in case I need to refer to it.
                                                                        This should also fix problems opening AS plugs that are listed as favorites and can deal with truncated names.
                                                                        Let me know if this works and sorry it took so long for me to fix it:

                                                                        sf.ui.proTools.appActivate();
                                                                        
                                                                        // Declare variables
                                                                        let pluginName;
                                                                        let trackName;
                                                                        
                                                                        // Define pluginWindow and AS Setings menu
                                                                        const plugInWindow = sf.ui.proTools.windows.whoseTitle.contains('Plug-in:').first
                                                                        
                                                                        const asSettingsMenu = sf.ui.proTools.firstAudioSuiteWindow.popupButtons.whoseTitle.is('Settings Menu').first;
                                                                        
                                                                        // Check if a plugin window is open. If not, abort
                                                                        if (!plugInWindow.exists) {
                                                                            sf.interaction.notify({
                                                                                title: "Please Select an Active Plugin",
                                                                            });
                                                                            throw 0
                                                                        }
                                                                        
                                                                        // Ensure plug-in window is focused
                                                                        if (!plugInWindow.isFocused) plugInWindow.elementRaise();
                                                                        
                                                                        // Get plug-in window values
                                                                        pluginName = plugInWindow.popupButtons.whoseTitle.contains('Plug-In Selector')
                                                                            .first.value.value;
                                                                        
                                                                        trackName = plugInWindow.popupButtons.whoseTitle.contains('Track Selector')
                                                                            .first.value.value;
                                                                        
                                                                        // Select track with plug-in
                                                                        sf.ui.proTools.trackGetByName({ name: trackName, makeVisible: true }).track.trackSelect();
                                                                        
                                                                        // Copy plugin settings
                                                                        const popupMenu = plugInWindow.popupButtons.whoseTitle.is('Settings menu')
                                                                            .first.popupMenuOpenFromElement().popupMenu;
                                                                        
                                                                        popupMenu.popupMenuSelect({
                                                                            menuPath: ["Copy Settings"],
                                                                        });
                                                                        
                                                                        // Open plugin popup menu, get plugin path and convert to AS menu path
                                                                        function getAsMenuPathFromPluginPopup(pluginName) {
                                                                            const groupRegex = new RegExp(pluginName)
                                                                            const pluginPopup = plugInWindow.popupButtons.whoseTitle.startsWith("Plug-In Selector").first;
                                                                        
                                                                            // get all paths with plugin name
                                                                            var paths = pluginPopup.popupMenuFetchAllItems({ dismissMenu: true }).menuItems
                                                                                .filter(menuItem => groupRegex.test(menuItem.path[menuItem.path.length - 1])).map(p => p.path);
                                                                        
                                                                            // Remove first part of each plugin path (multi-channel / nNative / HDX, etc)
                                                                            let editedPaths = paths.map(p => {
                                                                                let tempPath = Array.from(p)
                                                                                tempPath.shift();
                                                                                return tempPath
                                                                            });
                                                                        
                                                                            //Get path with exact name match (to differentiate between similar plugins (ie UAD vs. other brands)
                                                                            let matchedPaths = editedPaths.filter(p => p[1].startsWith(pluginName))
                                                                            return matchedPaths[0]
                                                                        };
                                                                        
                                                                        // Run get path function
                                                                        let asPath = (getAsMenuPathFromPluginPopup(pluginName))
                                                                        
                                                                        // Save original second part of path in case AS is not found
                                                                        const origPathPart2 = asPath[1]
                                                                        
                                                                        // Strip parenthesis (if any)from second path name (for Waves)
                                                                        if (asPath[1].endsWith(")")) {
                                                                            function stripParentheses(str) {
                                                                                // Regex to match the pattern "(content)" at the end of the string, capturing the content inside parentheses
                                                                                let regex = /\(([^)]*)\)$/;
                                                                        
                                                                                // Replace the matched pattern with the captured content
                                                                                return str.replace(regex, '$1');
                                                                            }
                                                                            asPath[1] = stripParentheses(asPath[1])
                                                                        }
                                                                        
                                                                        // Open AS Plugin
                                                                        const asFound = sf.ui.proTools.audioSuiteOpenPlugin({
                                                                            category: asPath[0],
                                                                            name: asPath[1],
                                                                            onError: "Continue"
                                                                        }).success;
                                                                        
                                                                        if (!asFound) {
                                                                            // usually due to (stereo / mono) suffex in menu path not shown in PT menu
                                                                            function splitAtLastParen(str) {
                                                                                // Find the index of the last " ("
                                                                                let lastIndex = str.lastIndexOf(" (");
                                                                        
                                                                                // If there is no " (", return the original string and an empty string
                                                                                if (lastIndex === -1) {
                                                                                    return [str, ""];
                                                                                }
                                                                        
                                                                                // Split the string at the last "("
                                                                                let beforeParen = str.substring(0, lastIndex);
                                                                                let afterParen = str.substring(lastIndex);
                                                                        
                                                                                return [beforeParen, afterParen];
                                                                            }
                                                                            asPath[1] = splitAtLastParen(origPathPart2)[0];
                                                                            // try opening new path
                                                                            sf.ui.proTools.audioSuiteOpenPlugin({
                                                                                category: asPath[0],
                                                                                name: asPath[1],
                                                                            })
                                                                        }
                                                                        // Paste Plug In Settings
                                                                        asSettingsMenu.invalidate().popupMenuSelect({
                                                                            menuPath: ["Paste Settings"],
                                                                        });
                                                                        
                                                                        1. refactored again to account for plugins with similar names ( "Vertigo VSC-2" vs. "UAD Vertigo VSC-2")

                                                                          1. In reply toChris_Shaw:

                                                                            Keep in mind - this script takes a few seconds if you have a large number of plug-ins installed

                                                                          2. In reply torobertsorling:
                                                                            Ben Rubin @Ben_Rubin
                                                                              2024-07-01 15:26:40.855Z

                                                                              thanks chris! glad to see this upon returning from vacation. will test out asap.

                                                                              1. Ben Rubin @Ben_Rubin
                                                                                  2025-03-24 01:13:15.467Z

                                                                                  Did test this out and it works great. With the new changes to how PT uses "Plug-in" vs "Plugin" some instances need to be changed to "Plugin" to get it to work. Basically all of them except for the name of the plugin window, which Avid didn't change for some reason.