No internet connection
  1. Home
  2. How to

Is there a Select Plug-In for Insert # Logic Pro X?

By The Canvas Group @The_Canvas_Group
    2020-12-25 03:42:55.781Z

    Can't seem to figure out how to make this happen... Is there any insight someone could point me to? Thanks!

    Solved in post #10, click to view
    • 46 replies

    There are 46 replies. Estimated reading time: 30 minutes

    1. Kitch Membery @Kitch2020-12-26 21:54:03.636Z

      Hi @The_Canvas_Group,

      I've not fully tested it, but If you'd like to open a plugin in the next available insert slot via the inspector panel you can try this;

      const logic = sf.ui.app('com.apple.logic10');
      const pluginPath = ['Audio Units', 'FabFilter', 'FF Pro-Q 3', 'Mono'];
      
      function openInspector() {
          const inspectorBtn = logic.mainWindow.groups.whoseDescription.is('Control Bar').first.checkBoxes.whoseTitle.is('Inspector').first;
      
          if (!inspectorBtn.isCheckBoxChecked) {
              inspectorBtn.elementClick();
          }
      }
      
      function addInsertNextFreeSlot(pluginPath) {
          const inspector = logic.mainWindow.groups.whoseDescription.is('Inspector').first;
          const mixer = inspector.children.whoseRole.is("AXList").first.groups.allItems[2].children.whoseRole.is("AXLayoutArea").whoseDescription.is('Mixer').first
      
          mixer.children.whoseRole.is("AXLayoutItem").first.buttons.whoseDescription.is('audio plug-in').first.popupMenuSelect({
              menuPath: pluginPath,
          });
      }
      
      function main() {
          logic.appActivateMainWindow();
          logic.mainWindow.invalidate();
      
          openInspector();
      
          addInsertNextFreeSlot(pluginPath);
      }
      
      main();
      
      
      1. TThe Canvas Group @The_Canvas_Group
          2020-12-28 22:39:01.517Z

          hey man!

          this has been working great on my main studio computer but for some reason I'm getting an error on line 16 that I haven't been able to resolve on mobile rig.

          Could not open popup menu (Add Channel EQ (Stereo): Line 16)

          Not sure why it would be working somewhere and not somewhere else..

          Any thoughts?

          1. Kitch Membery @Kitch2020-12-28 22:45:22.906Z

            Hmm.. Can you post the script you are using?

            Are you adding the plugin to an audio track, instrument track, or another type of track?

            Better yet if you could upload a screen capture of it that would probably reveal the issue to me.

            1. TThe Canvas Group @The_Canvas_Group
                2020-12-28 23:16:24.194Z

                I'm using your script above w/ a few modifiers (That you'll see in the Screen Caps).

                The examples I'm sending are just on Audio Tracks right now.

                The 2 Screen Caps are one of it working (on a MacPro 2019) and one of it not (on a 16" Macbook Pro 2019).

                1. https://youtu.be/cMnST8r0K30
                1. Kitch Membery @Kitch2020-12-28 23:34:27.241Z

                  Thanks for that...

                  Unfortunately, Logic Pro x tends to change its UI elements depending on how the page is setup. I'd have to do some troubleshooting to see what the problem is but at first glance it may be to do with the "Region" and "Audio" sections being collapsed, or the introduction of the preamp gain option at the top of the track.

                  I'll take a look and see if I can figure out the issue sometime this week (us logic pro users need this script :-) ).

                  1. TThe Canvas Group @The_Canvas_Group
                      2020-12-29 19:25:27.849Z

                      Thanks, man.

                      It's odd that it works on one computer but not the other but I'm not familiar enough with coding to really figure this out on my own.

                      Learning a lot from you and simple trial and error though.

                      1. Kitch Membery @Kitch2020-12-29 19:52:53.040Z

                        You are welcome @The_Canvas_Group,

                        I just worked out that if you have the "Quick Help" Visible in the Inspector that it changes the UI layout. As a temporary fix hide it and the script should work. :-)

                        Rock on!

                        1. Kitch Membery @Kitch2020-12-29 20:12:26.540Z

                          @The_Canvas_Group,

                          Here is fix for that issue, assuming Logic's ui elements don't change with some other configuration...

                          const logic = sf.ui.app('com.apple.logic10');
                          const pluginPath = ['Audio Units', 'FabFilter', 'FF Pro-Q 3', 'Mono'];
                          
                          function openInspector() {
                              const inspectorBtn = logic.mainWindow.groups.whoseDescription.is('Control Bar').first.checkBoxes.whoseTitle.is('Inspector').first;
                          
                              if (!inspectorBtn.isCheckBoxChecked) {
                                  inspectorBtn.elementClick();
                              }
                          }
                          
                          function addInsertNextFreeSlot(pluginPath) {
                              const inspector = logic.mainWindow.groups.whoseDescription.is('Inspector').first;
                          
                              try {
                                  let mixer = inspector.children.whoseRole.is("AXList").first.groups.allItems[2].children.whoseRole.is("AXLayoutArea").whoseDescription.is('Mixer').first
                                  mixer.children.whoseRole.is("AXLayoutItem").first.buttons.whoseDescription.is('audio plug-in').first.popupMenuSelect({
                                      menuPath: pluginPath,
                                  });
                              } catch (err) {
                                  let mixer = inspector.children.whoseRole.is("AXList").first.groups.allItems[3].children.whoseRole.is("AXLayoutArea").whoseDescription.is('Mixer').first
                                  mixer.children.whoseRole.is("AXLayoutItem").first.buttons.whoseDescription.is('audio plug-in').first.popupMenuSelect({
                                      menuPath: pluginPath,
                                  });
                              }
                          }
                          
                          function main() {
                              logic.appActivateMainWindow();
                              logic.mainWindow.invalidate();
                          
                              openInspector();
                          
                              addInsertNextFreeSlot(pluginPath);
                          }
                          
                          main();
                          
                          Reply1 LikeSolution
                          1. TThe Canvas Group @The_Canvas_Group
                              2020-12-29 21:13:57.523Z

                              You're a legend, mate. Thank you. And thak you for being so open with your knowledge.

                              1. Kitch Membery @Kitch2020-12-29 21:18:23.706Z

                                No worries mate. My pleasure. :-)

                                1. Kitch Membery @Kitch2020-12-30 02:51:01.373Z

                                  @The_Canvas_Group,

                                  I just went for a walk and had an idea on how to improve the script so that it works in scenarios where the Logic Pro UI changes. Here is the revised script.

                                  const logic = sf.ui.app('com.apple.logic10');
                                  const pluginPath = ['Audio Units', 'FabFilter', 'FF Pro-Q 3', 'Mono'];
                                  
                                  function openInspector() {
                                      const inspectorBtn = logic.mainWindow.groups.whoseDescription.is('Control Bar').first.checkBoxes.whoseTitle.is('Inspector').first;
                                  
                                      if (!inspectorBtn.isCheckBoxChecked) {
                                          inspectorBtn.elementClick();
                                      }
                                  }
                                  
                                  function addInsertNextFreeSlot(pluginPath) {
                                      const inspector = logic.mainWindow.groups.whoseDescription.is('Inspector').first;
                                  
                                      inspector.childrenByRole("AXList").first.groups
                                          .filter(group => group.children.whoseDescription.is('Mixer').first.childrenByRole("AXLayoutItem").first.buttons.whoseDescription.is('audio plug-in').first.exists)
                                          .map(group => group.children.whoseDescription.is('Mixer').first.childrenByRole("AXLayoutItem").first.buttons.whoseDescription.is('audio plug-in').first.popupMenuSelect({
                                              menuPath: pluginPath,
                                          }));
                                  }
                                  
                                  function main() {
                                      logic.appActivateMainWindow();
                                      logic.mainWindow.invalidate();
                                  
                                      openInspector();
                                  
                                      addInsertNextFreeSlot(pluginPath);
                                  }
                                  
                                  main();
                                  
                                  1. Kitch Membery @Kitch2020-12-30 10:41:47.441Z

                                    Hi @Dan_Radclyffe,

                                    I thought the above script may pique your interest. :-)

                                    https://forum.soundflow.org/-3719#post-13
                                    1. DDan Radclyffe @Dan_Radclyffe
                                        2020-12-30 12:40:26.145Z

                                        Thanks for thinking of me :) I get an error on line 15? I have Pro Q-3 too.

                                        For loading plugins i'm actually using Speakerfood PlugSearch, its an app that lets you search for plugins by typing. Works nicely!

                                        1. In reply toKitch:
                                          DDan Radclyffe @Dan_Radclyffe
                                            2021-01-05 16:29:33.727Z

                                            This works! Dope. I had to un-collapse the Track menu from the inspector.

                                            So fast too!

                                            One question: How could the script be modified to launch one plug-in after the other? As assuming I can't copy and paste the script to follow itself and then change the plug-in name?

                                            I use a particular Haas delay plugin constantly but it only opens on stereo channels (no mono>stereo option)

                                            So it always needs to be preceded by a mono>stereo instance of logic's gain plugin to make the track stereo.

                                            (I could click to make the track stereo at the top of my channel strip but that would needlessly make all my other plugins stereo)

                                            1. DDan Radclyffe @Dan_Radclyffe
                                                2021-01-05 19:19:07.893Z

                                                @Kitch ignore me. It totally works to copy and paste the script!

                                                1. Kitch Membery @Kitch2021-01-06 03:24:42.100Z

                                                  These are all great suggestions @Dan_Radclyffe... and I'm glad you got it working.

                                                  I plan on creating some command templates for these (When I have time) so they are customizable.

                                                  I'll let you know when I get around to it as It would be great to have these features (and more) in a package for the SoundFlow / Logic Pro X users.

                                                  Rock on!

                                                  PS. Good to know that the track menu from the inspector is causing issues with the UI layout, I'll track that down and sort it out when I get a moment.

                                                  1. DDan Radclyffe @Dan_Radclyffe
                                                      2021-01-07 14:52:46.712Z

                                                      Another suggestion if you'll indulge me. A script to REMOVE the last plugin in the slot.

                                                      This script is fantastic for auditioning different plugins quickly, but would be good to not have to manually remove them if you want to try another option?

                                              • In reply toKitch:
                                                TThe Canvas Group @The_Canvas_Group
                                                  2020-12-30 20:51:05.208Z

                                                  Hot damn. This is great.

                                                  1. Kitch Membery @Kitch2020-12-30 20:51:55.417Z

                                                    Hahahah :-) Rock on!

                                                    1. TThe Canvas Group @The_Canvas_Group
                                                        2020-12-30 21:16:58.171Z

                                                        I've just been going through and subbing out elements to map to my streamdeck.
                                                        Man, is it time consuming but all this prep is so worth it for the time it'll save not having to menu dive.
                                                        Thank you again.

                                                        1. Kitch Membery @Kitch2020-12-30 21:21:57.562Z

                                                          Nice one!! When I get a chance I'll have to make some Command templates of a few of my Logic Pro X scripts so to easily make some presets.

                                                          BTW... Check this post for setting outputs in Logic Pro X.

                                                          https://forum.soundflow.org/-3589#post-17
                                                          1. TThe Canvas Group @The_Canvas_Group
                                                              2020-12-30 21:59:03.590Z

                                                              This one is DEFINITELY useful.

                                                              2 Questions:

                                                              1. Is there a script that changes software-instruments outputs to different outputs that I missed?

                                                              2. Is there a script that sends to designated sends?

                                                              1. Kitch Membery @Kitch2020-12-30 22:01:23.747Z

                                                                Not that I know of, but I'll add it to the list of to-do's :-)

                                                              2. In reply toKitch:
                                                                TThe Canvas Group @The_Canvas_Group
                                                                  2020-12-30 22:00:10.948Z

                                                                  And yeah, a preset chain command would be HUGE.
                                                                  Especially if it's not something already built into a template.

                                                          2. In reply toKitch:
                                                            DDan Radclyffe @Dan_Radclyffe
                                                              2021-01-30 22:01:16.334Z

                                                              Just thought i'd chime in on the very start of this script:

                                                              const logic = sf.ui.app('com.apple.logic10'); const pluginPath = ['Audio Units', 'FabFilter', 'FF Pro-Q 3', 'Mono'];

                                                              If you try and launch this on a stereo track, the script will fail. As it specifies a 'Mono' instance.

                                                              If you remove the word mono from it:

                                                              const logic = sf.ui.app('com.apple.logic10'); const pluginPath = ['Audio Units', 'FabFilter', 'FF Pro-Q 3'];

                                                              and then stick this at the end of the entire script:

                                                              sf.keyboard.press({ keys: "right, return", });

                                                              It will now select the default for whatever type of track you're working on: Mono or Stereo. i.e the first option to the right of the plug-in name.

                                                              ):

                                                              1. TThe Canvas Group @The_Canvas_Group
                                                                  2021-01-30 23:42:48.384Z

                                                                  Massive up here, man.

                                                                  Thank you.

                                              • D
                                                Dan Radclyffe @Dan_Radclyffe
                                                  2021-03-31 09:29:49.797Z

                                                  @Kitch

                                                  I love launching plugs in Logic using this script, but wanted to run something by y'all.

                                                  Say the routing destination (default: stereo bus) of your channel has four plugins on it, running the script inserts a plugin on slot #5, leaving four empty slots before it. Same goes if the destination bus has ANY plugins on it. The script will insert it leaving empty slots above as appropriate.

                                                  See below. Any ideas on how to fix?

                                                  1. DDan Radclyffe @Dan_Radclyffe
                                                      2021-05-09 18:45:45.712Z

                                                      Just bumping this in case anyone can help out?

                                                      1. DDan Radclyffe @Dan_Radclyffe
                                                          2021-06-09 20:27:03.465Z

                                                          @Kitch any ideas on this one? It’s really stopping me from these scripts being a time-saver. As it stands I always have to wait for the plugin to load, close the GUI, then drag it to the slot I actually wanted to load it on. Much faster to use the PlugSearch app from Speakerfood. Shame. Thanks!

                                                          1. RRyan Hayes @Ryan_Hayes
                                                              2021-12-22 18:18:44.545Z

                                                              Hey Dan, Create a macro to "Empty open plugin slots" by using
                                                              "open pop up menu and select Item" on settings bar of the channel trip.
                                                              This will bring that plugin down to the next open slot. For some reason the faders are linked in for seeing next open slot. You can create one for the stereo out and for the channel strip. Hope this helps.

                                                              Ryan

                                                              1. DDan Radclyffe @Dan_Radclyffe
                                                                  2021-12-22 18:33:47.133Z

                                                                  Thanks for this. Might you be able to post an example script? I’ve not had much luck with getting SF to do anything consistent involving the inspector in Logic. Also pop-up menus in general.

                                                                  I’m currently using SF to control the latest version of PlugSearch. Works pretty well!

                                                                  1. RRyan Hayes @Ryan_Hayes
                                                                      2021-12-22 18:38:45.776Z2021-12-22 22:40:31.761Z

                                                                      Dan, You can add this onto your plugin loader macro. Take out the active app if you add it to an existing macro. This doesnt work with GROUPS though. Still trying to figure that out. Otherwise its does the job. Let me know if it works for you.

                                                                      sf.ui.app('com.apple.logic10').appActivate();
                                                                      
                                                                      sf.ui.app("com.apple.logic10").mainWindow.groups.whoseDescription.is("Inspector").first.children.whoseRole.is("AXList").first.groups.allItems[3].children.whoseRole.is("AXLayoutArea").whoseDescription.is("Mixer").first.children.whoseRole.is("AXLayoutItem").first.buttons.whoseDescription.is("setting").first.popupMenuSelect({
                                                                          menuPath: ["Remove Empty Insert Slots"],
                                                                      });
                                                                      
                                                                      1. DDan Radclyffe @Dan_Radclyffe
                                                                          2021-12-23 14:48:32.551Z

                                                                          Not working for me, unless i'm putting it in the wrong place. For example how would you tweak this script I use for Soothe:

                                                                          const logic = sf.ui.app('com.apple.logic10');
                                                                          const pluginPath = ['Audio Units', 'oeksound', 'soothe2'];
                                                                          
                                                                          function openInspector() {
                                                                              const inspectorBtn = logic.mainWindow.groups.whoseDescription.is('Control Bar').first.checkBoxes.whoseTitle.is('Inspector').first;
                                                                          
                                                                              if (!inspectorBtn.isCheckBoxChecked) {
                                                                                  inspectorBtn.elementClick();
                                                                              }
                                                                          }
                                                                          
                                                                          function addInsertNextFreeSlot(pluginPath) {
                                                                              const inspector = logic.mainWindow.groups.whoseDescription.is('Inspector').first;
                                                                          
                                                                              inspector.childrenByRole("AXList").first.groups
                                                                                  .filter(group => group.children.whoseDescription.is('Mixer').first.childrenByRole("AXLayoutItem").first.buttons.whoseDescription.is('audio plug-in').first.exists)
                                                                                  .map(group => group.children.whoseDescription.is('Mixer').first.childrenByRole("AXLayoutItem").first.buttons.whoseDescription.is('audio plug-in').first.popupMenuSelect({
                                                                                      menuPath: pluginPath,
                                                                                  }));
                                                                          }
                                                                          
                                                                          function main() {
                                                                              logic.appActivateMainWindow();
                                                                              logic.mainWindow.invalidate();
                                                                          
                                                                              openInspector();
                                                                          
                                                                              addInsertNextFreeSlot(pluginPath);
                                                                          }
                                                                          
                                                                          main();
                                                                          
                                                                          sf.keyboard.press({
                                                                              keys: "right, return",
                                                                          });
                                                                          
                                                                          1. RRyan Hayes @Ryan_Hayes
                                                                              2021-12-27 19:15:41.121Z

                                                                              Hey Dan, Only works in Logic 10.7 and later. What version are you on?

                                                                              1. In reply toDan_Radclyffe:
                                                                                RRyan Hayes @Ryan_Hayes
                                                                                  2021-12-27 20:07:01.585Z

                                                                                  Hey Dan, You alrady try this? If you are in another version of logic the name of the commands are different so it wont work but in 10.7.

                                                                                  const logic = sf.ui.app('com.apple.logic10');
                                                                                  const pluginPath = ['Audio Units', 'oeksound', 'soothe2'];

                                                                                  function openInspector() {
                                                                                  const inspectorBtn = logic.mainWindow.groups.whoseDescription.is('Control Bar').first.checkBoxes.whoseTitle.is('Inspector').first;

                                                                                  if (!inspectorBtn.isCheckBoxChecked) {
                                                                                      inspectorBtn.elementClick();
                                                                                  }
                                                                                  

                                                                                  }

                                                                                  function addInsertNextFreeSlot(pluginPath) {
                                                                                  const inspector = logic.mainWindow.groups.whoseDescription.is('Inspector').first;

                                                                                  inspector.childrenByRole("AXList").first.groups
                                                                                      .filter(group => group.children.whoseDescription.is('Mixer').first.childrenByRole("AXLayoutItem").first.buttons.whoseDescription.is('audio plug-in').first.exists)
                                                                                      .map(group => group.children.whoseDescription.is('Mixer').first.childrenByRole("AXLayoutItem").first.buttons.whoseDescription.is('audio plug-in').first.popupMenuSelect({
                                                                                          menuPath: pluginPath,
                                                                                      }));
                                                                                  

                                                                                  }

                                                                                  function main() {
                                                                                  logic.appActivateMainWindow();
                                                                                  logic.mainWindow.invalidate();

                                                                                  openInspector();
                                                                                  
                                                                                  addInsertNextFreeSlot(pluginPath);
                                                                                  

                                                                                  }

                                                                                  main();

                                                                                  sf.keyboard.press({
                                                                                  keys: "right, return",
                                                                                  });

                                                                                  sf.ui.app("com.apple.logic10").mainWindow.groups.whoseDescription.is("Inspector").first.children.whoseRole.is("AXList").first.groups.allItems[3].children.whoseRole.is("AXLayoutArea").whoseDescription.is("Mixer").first.children.whoseRole.is("AXLayoutItem").first.buttons.whoseDescription.is("setting").first.popupMenuSelect({
                                                                                  menuPath: ["Remove Empty Insert Slots"],
                                                                                  });

                                                                                  1. DDan Radclyffe @Dan_Radclyffe
                                                                                      2021-12-27 20:40:15.209Z

                                                                                      Ah. I'm either in 10.4.8 or 10.6.3 as i'm only (just) on Catalina. Thanks for this- will try out in a couple of weeks when back in my studio!

                                                                      2. J
                                                                        Johan Nordin @Johan_Nordin
                                                                          2021-05-15 16:55:36.323Z

                                                                          Hello! Really amazing script, use it all the time. 👌

                                                                          I wonder if there’s a way to always insert a plugin in slot #1. For example, ARA plugins always need to be in the first slot and if there’s already plugins on that track, the exciting script is not working. I tried to modify the script without luck.

                                                                          Johan

                                                                          1. RRyan Hayes @Ryan_Hayes
                                                                              2021-12-22 18:30:27.953Z2021-12-22 22:37:50.325Z

                                                                              Hey Johan, This one will work as long as there is no plugin. You could add a remove plugin command before it if you want. This is a simple one I build where you start in the main window. open you rmix window and make sure you can see the plug in slots. Close it highlight your tracks and hit the command. It will load melodyne ara on all selected tracks in the window on slot 1. It hits play to process the audio then opens the plugin. Ive used it 200 times now and want to make some tweaks but it works for me for now. Hop ethis helps.

                                                                              sf.ui.app('com.apple.logic10').appActivate();
                                                                              
                                                                              sf.keyboard.press({
                                                                                  keys: "x",
                                                                                  fast: true,
                                                                              });
                                                                              
                                                                              sf.ui.app("com.apple.logic10").mainWindow.groups.whoseDescription.is("Mixer").first.children.whoseRole.is("AXLayoutArea").whoseDescription.is("Mixer").first.children.whoseRole.is("AXLayoutItem").allItems[19].buttons.whoseDescription.is("audio plug-in").allItems[1].popupMenuSelect({
                                                                                  menuPath: ["Audio Units","Celemony","Melodyne (ARA)"],
                                                                              });
                                                                              
                                                                              sf.keyboard.press({
                                                                                  keys: "right, return",
                                                                              });
                                                                              
                                                                              sf.keyboard.press({
                                                                                  keys: "return",
                                                                              });
                                                                              
                                                                              sf.ui.app("com.apple.logic10").children.whoseRole.is("AXWindow").first.getElement("AXCloseButton").elementClick();
                                                                              
                                                                              sf.keyboard.press({
                                                                                  keys: "x",
                                                                                  fast: true,
                                                                              });
                                                                              
                                                                              sf.wait({
                                                                                  intervalMs: 1500,
                                                                              });
                                                                              
                                                                              sf.keyboard.press({
                                                                                  keys: "space",
                                                                              });
                                                                              
                                                                              sf.wait({
                                                                                  intervalMs: 1000,
                                                                              });
                                                                              
                                                                              sf.keyboard.press({
                                                                                  keys: "space",
                                                                              });
                                                                              
                                                                              sf.keyboard.press({
                                                                                  keys: "right",
                                                                              });
                                                                              
                                                                              sf.keyboard.press({
                                                                                  keys: "shift+1",});
                                                                              
                                                                              1. JJohan Nordin @Johan_Nordin
                                                                                  2021-12-27 19:13:37.625Z

                                                                                  Thank you so much @Ryan_Hayes. I tried to copy the code and run the script but I got stock at Line 8.

                                                                                  27.12.2021 20:11:17.99 [Backend]: !! Command Error: Insert Melodyne ARA [user:ckopptzmv000jua10s09snczv:ckopqr2zg001jua102pgw0704]:
                                                                                  Could not open popup menu (Insert Melodyne ARA: Line 8)
                                                                                  popupMenu.open.fromElement requires an element

                                                                                  Any idea what might be causing the error? Best, Johan

                                                                                  1. RRyan Hayes @Ryan_Hayes
                                                                                      2021-12-27 19:53:58.589Z2021-12-27 20:02:07.164Z

                                                                                      Hey Johan, try that last one with no plugins on slot 1. Once you posted this I got the same error.

                                                                                      This one should just work for taking off plugin 1 and adding melodyne ARA on selected tracks.

                                                                                      Also make sure your
                                                                                      ARA version is validated in plugin manager. If not it wont show up in the show up. You prob already got that though.

                                                                                      I Need to get SF to look for two popup menues and throw error if the first 1st button doesnt exist. Then I can make it into one script easily.

                                                                                      Anyone know how to make a Throw error for a Open Pop up Menu like on a "wait for ui element command"?

                                                                                      let me know if this works for you.
                                                                                      LOAD Melodyne ARA on Selected Tracks in Mixer Window with a plugin on slot 1 which will be replaced with ARA.

                                                                                      sf.ui.app('com.apple.logic10').appActivate();
                                                                                      
                                                                                      sf.keyboard.press({
                                                                                          keys: "x",
                                                                                          fast: true,
                                                                                      });
                                                                                      
                                                                                      sf.ui.app("com.apple.logic10").mainWindow.groups.whoseDescription.is("Mixer").first.children.whoseRole.is("AXLayoutArea").whoseDescription.is("Mixer").first.children.whoseRole.is("AXLayoutItem").allItems[40].groups.allItems[5].buttons.whoseDescription.is("list").first.popupMenuSelect({
                                                                                          menuPath: ["Audio Units","Celemony","Melodyne (ARA)"],
                                                                                      });
                                                                                      
                                                                                      sf.keyboard.press({
                                                                                          keys: "right, return",
                                                                                      });
                                                                                      
                                                                                      sf.keyboard.press({
                                                                                          keys: "return",
                                                                                      });
                                                                                      
                                                                                      sf.ui.app("com.apple.logic10").children.whoseRole.is("AXWindow").first.getElement("AXCloseButton").elementClick();
                                                                                      
                                                                                      sf.keyboard.press({
                                                                                          keys: "x",
                                                                                          fast: true,
                                                                                      });
                                                                                      
                                                                                      sf.wait({
                                                                                          intervalMs: 1500,
                                                                                      });
                                                                                      
                                                                                      sf.keyboard.press({
                                                                                          keys: "space",
                                                                                      });
                                                                                      
                                                                                      sf.wait({
                                                                                          intervalMs: 2000,
                                                                                      });
                                                                                      
                                                                                      sf.keyboard.press({
                                                                                          keys: "space",
                                                                                      });
                                                                                      
                                                                                      sf.keyboard.press({
                                                                                          keys: "right",
                                                                                      });
                                                                                      
                                                                                      sf.keyboard.press({
                                                                                          keys: "shift+1",
                                                                                      });
                                                                                      
                                                                                      1. JJohan Nordin @Johan_Nordin
                                                                                          2021-12-28 09:34:08.491Z

                                                                                          Thank you for a fast answer. :)
                                                                                          Still getting error message on Line 8 thought.

                                                                                          28.12.2021 10:33:42.77 [Backend]: !! Command Error: Insert Melodyne ARA [user:ckopptzmv000jua10s09snczv:ckopqr2zg001jua102pgw0704]:
                                                                                          Could not open popup menu (Insert Melodyne ARA: Line 8)
                                                                                          popupMenu.open.fromElement requires an element

                                                                                          Any ideas? :) Best, Johan

                                                                                          1. RRyan Hayes @Ryan_Hayes
                                                                                              2022-01-02 18:41:21.407Z

                                                                                              You on logic 10.7?

                                                                                              1. JJohan Nordin @Johan_Nordin
                                                                                                  2022-01-05 09:18:13.038Z

                                                                                                  No, Logic 10.6.2. :)

                                                                                                  1. RRyan Hayes @Ryan_Hayes
                                                                                                      2022-01-19 04:55:42.471Z

                                                                                                      Ah Menus changed in 10.7. That would be why.

                                                                                                      1. OOscar Fogelstrom @Oscar_Fogelstrom
                                                                                                          2022-02-03 18:47:25.774Z

                                                                                                          I am getting a similar error on Logic 10.7.2 (for both scripts).
                                                                                                          "Could not open popup menu (Load plugin test: Line 8)"

                                                                                          2. Kitch Membery @Kitch2024-03-13 23:01:48.992Z

                                                                                            Hi @The_Canvas_Group & @Johan_Nordin

                                                                                            I just thought I'd give you a heads up in case you were not aware, recently we added an Official Logic Pro package to SoundFlow that includes, Plugin, Instrument, MIDI FX, and Send loaders + much more. The package is available in the SoundFlow Store and requires Logic Pro 10.8 and above, and SoundFlow 5.7.0.

                                                                                            If you're interested, we'll be holding a webinar tomorrow Thursday 14th March at 11 am PST. If you are interested, be sure to register at the following link:

                                                                                            https://soundflow.org/events/2024-03-logic-pro-webinar

                                                                                            I hope you can attend. :-)