No internet connection
  1. Home
  2. Support

open plug-ins on audio or aux tracks - version 2

By Martin Klebahn @Martin_Klebahn
    2019-09-16 20:45:37.965Z2019-09-18 03:09:31.813Z

    The script is opening a window to select a plug-in slot:

    The problem is that a mouse click is needed to select. Is there a way to pre select a slot by the sript? Arrow keys could then change the slot?

    Then there is an error at line 21.

    Any ideas?

    ADMIN EDIT: This was continued from this post:
    https://forum.soundflow.org/-936/open-plugins-on-an-audio-or-aux-track

    • 12 replies
    1. Hi @Martin_Klebahn.

      Do you have inserts and sends showing in your Edit window when you get the error on line 21?
      What it appears to be saying is that it can't find the insert button corresponding to the insert number you chose in the list.

      Isn't this topic a copy of another topic by the way? Maybe it'd be better to focus the discussion in one topic.

      1. Can I get you to copy/paste the code instead of the screenshot? I'll have to re-write everything from the image to test it.
        To properly embed code in the forum, type three back ticks ``` on a line before, and also on a line after, the code.

        1. MMartin Klebahn @Martin_Klebahn
            2019-09-17 15:42:02.470Z

            Yes, we'veanother topic about the same. It got me confused because repies were all over. Therefore I put this as version 2.
            Now I'm back to the asterik in line 5.
            It worked several times. Then sometimes I'm getting the error in line 21 again…

            Besides of this the most important thing would to fix the pop up box with the slots. If there's nothing preselected then I need the mouse again and 2 clicks are needed to continue. One is activating the dialog and with the second I've to select the slot. It would be more elegant to have - lets say slot 1 already selected and the change this with the arrow keys. Is there a way to implement this?

            1. Gotcha, no problem, we'll link the two topics together.

              Then sometimes I'm getting the error in line 21 again…
              When you get that error, can you double check if there's anything else that could cause this? Is it intermittent (ie. can it happen to the same track, or does it always happen on specific tracks). Right now we're looking for a multichannel Native plug-in. This would not work on a mono track for example.

              To fix the selection/focus problem, let's use a different action to select the insert:

              var pluginPath = [
                  'multichannel Native plug-in',
                  'EQ',
                  'EQ3 7-Band*'
              ];
              
              var freeInsertButtonIndices = sf.ui.proTools.selectedTrack.insertButtons.map(function (btn, i) {
                  return (btn.invalidate().value.value === 'unassigned') ? i : -1;
              }).filter(function (i) { return i >= 0; });
              
              var index = sf.interaction.popupSearch({
                  items: freeInsertButtonIndices.map(function(i){ return { name: "Insert " + (i+1), index: i } }),
                  title: 'Select insert',
              }).item.index;
              
              sf.ui.proTools.appActivateMainWindow();
              
              var insertBtn = sf.ui.proTools.selectedTrack.insertButtons[index];
              insertBtn.popupMenuSelect({
                  menuPath: pluginPath,
                  useWildcards: true,
              });
              
              1. MMartin Klebahn @Martin_Klebahn
                  2019-10-01 13:32:26.695Z

                  Hello Christian,
                  thank you for the script. This one is opening audio suite version of EQ3 though.
                  Is there a chance to find working scripts for opening plug-ins and sends on audio and aux tracks? Or is this just close to the edge?

                  1. That sounds very strange. This definitely should not open up AudioSuite versions, since it clicks on the insert selector and goes through that insert selector's popup menu. Are you sure you used the code quoted here above?

          • M
            In reply toMartin_Klebahn:
            Martin Klebahn @Martin_Klebahn
              2019-09-17 15:12:30.128Z2019-09-17 15:18:42.945Z

              Hi Christian,

              yes the inserts are shown in the edit window.
              Here's the code:

              var pluginPath = [
                  'multichannel Native plug-in',
                  'EQ',
                  'EQ3 7-Band'
              ];
              
              var freeInsertButtonIndices = sf.ui.proTools.selectedTrack.insertButtons.map(function (btn, i) {
                  return (btn.invalidate().value.value === 'unassigned') ? i : -1;
              }).filter(function (i) { return i >= 0; });
              
              var index = Number(sf.interaction.selectFromList({
                  items: freeInsertButtonIndices.map(function(i){ return "Insert " + (i+1) }),
                  prompt: "Which insert slot do you want to insert the plugin on?",
                  title: "Insert plugin"
              }).list[0].match(/(\d+)$/)[1]) - 1;
              
              sf.ui.proTools.appActivateMainWindow();
              
              var insertBtn = sf.ui.proTools.selectedTrack.insertButtons[index];
              insertBtn.popupMenuSelect({
                  menuPath: pluginPath,
                  useWildcards: true,
              });
              
              1. Thanks Martin. Ok I'll take a look.

                1. Ah ok. The line 21 error comes because there's no wildcard at the end of your line here: 'EQ3 7-Band' - it should be 'EQ3 7-Band*', or you should specify explicitly the full name of the menu item. If you click manually all the way through on the track, we need to tell SoundFlow that full path.

              2. In reply toMartin_Klebahn:
                Todd Burke @Todd_Burke8
                  2020-07-03 18:27:53.722Z

                  Just wondering if this "opening plugins on audio/aux tracks" concept has been abandoned or is a solution elsewhere? I'd love to get this going!

                  I'm fiddling with some code from further up this page, which work well on mono tracks but fails on stereo tracks.

                  Just wondering if anyone has nailed this.

                  1. Hi Todd.
                    There are tons of threads in the forum around opening inserts. This particular thread is about inserting a plugin onto a specific insert via a popup window.
                    I think you'd get more help if you started a new thread with exactly what you're looking for :)

                    1. One example can be found here, where the desired behavior is to insert onto the next freely available slot - the code quoted here works for all track types:
                      https://forum.soundflow.org/-1674#post-2