No internet connection
  1. Home
  2. Support

Logic Pro - add/replace plugins on selected track

By Jon Newell @Jon_Newell
    2020-06-02 22:49:56.386Z

    Is there a foolproof way to tell SF to click the Instrument menu in Logic? I'd like to press a button on my Streamdeck which would load Omnisphere on the selected track.

    I made this as a macro, and sometimes it works. I'm not completely sure what the conditions are that make it fail or succeed.

    sf.ui.app('com.apple.logic10').mainWindow.groups.whoseDescription.is('Inspector').first.children.whoseRole.is("AXList").first.groups.allItems[3].children.whoseRole.is("AXLayoutArea").first.children.whoseRole.is("AXLayoutItem").first.buttons.allItems[7].popupMenuSelect({
        menuPath: ["AU Instruments","Spectrasonics","Omnisphere","Stereo"],
    });
    

    Thanks again for your help!

    • 9 replies
    1. Hi Jon.

      Due to the way Logic lays out UI, it's slightly complicated - but the following script works here in my testing.
      Note it may need substantial more work to work for all cases.

      
      function getInstrumentSelectorListButton() {
          var inspector = sf.ui.app('com.apple.logic10').mainWindow.groups.whoseDescription.is('Inspector').first;
          if (!inspector.exists) throw 'Could not find Inspector';
      
          var mixer = inspector.children.whoseRole.is("AXList").first.groups.allItems.filter(grp => grp.children.whoseRole.is("AXLayoutArea").whoseDescription.is('Mixer').exists)[0].children.whoseRole.is("AXLayoutArea").whoseDescription.is('Mixer').first;
          if (!mixer.exists) throw 'Could not find Mixer';
      
          var selectedTrackChannelStrip = mixer.children.whoseRole.is("AXLayoutItem").first;
          if (!selectedTrackChannelStrip.exists) throw 'Could not find selected channel strip';
      
          var instrumentSelectorGroup = selectedTrackChannelStrip.groups.allItems.filter(g => {
              var gDesc = g.getString("AXDescription");
              if (gDesc.match(/^(automation|Bus \d?)$/)) return false;
              var neededChildren = ['bypass', 'open', 'list'];
              if (!neededChildren.every(n => g.children.whoseDescription.is(n).exists)) return false;
              return true;
          })[0];
          if (!instrumentSelectorGroup) throw 'Could not find instrument selector';
      
          var listButton = instrumentSelectorGroup.children.whoseDescription.is('list').first;
          return listButton;
      }
      
      getInstrumentSelectorListButton().popupMenuSelect({
          menuPath: ['Vintage Clav', 'Stereo']
      });
      
      1. JJon Newell @Jon_Newell
          2020-06-03 15:10:00.716Z

          Thanks so much for your hard work!

          When I load up a fresh Logic session (no template) with one instrument track, this script throws "Could not find instrument selector".

          Version is Logic 10.5

          Is SF with Logic something I should keep pursuing? I really like the software and the support, but I'm aware that it's not sold as a Logic solution. I dont want to be "that one Logic guy" that takes up too much of your time for just $10/mo.

          Thanks again for your help!

          -Jon

          1. Hi Jon.

            We have plans to extend support to Logic more officially in the future, so you're actually helping us by asking questions. It helps us understand what Logic users can't already do, which is very helpful for planning any potential features in the future.

            The one thing hard about Logic is that they tend to change quite a lot in the UI code for every release, and we're pretty far behind adding features to it. But hopefully we can schedule a release some time in the future to be a little more focused on this.

            I imagine I'll need Logic 10.5 to fix the above, as likely the UI structure is just different from the 10.4 version I'm currently running.

            1. One quick thing to check: Does it start working, if you've already selected an instrument on the track?

              1. In reply tochrscheuer:
                JJon Newell @Jon_Newell
                  2020-06-03 20:40:57.743Z

                  That's great to hear! I'm happy to be a test case, and I'll keep bringing the questions!

                  In this example I get "Error in line 24, could not click popup menu"

                  When I use the macro editor to grab the popup in that screenshot the result is

                  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").whoseDescription.is('Massive').first.groups.whoseDescription.is('Kontakt 5').first.buttons.whoseDescription.is('list').first.popupMenuSelect();
                  
                  
                  1. Gotcha. Thanks for the info. I think it's complex enough that I'd need to install Logic 10.5 here to really get anything going. @Kitch may also be able to help, but we're probably both too busy until after June 15 (something exciting coming...) :)
                    If you don't mind, can we check back in on this after June 15? I'd love to help get some initial work going.

            2. R
              In reply toJon_Newell:
              Ryan Hayes @Ryan_Hayes
                2021-10-26 04:17:18.856Z2021-12-22 00:30:01.278Z

                Hey guys, im on 10.7 logic. Ive been using “open pop up menu and select item” on inspector slots (far left) then typing out the path in the menu path field. Logic 10.4-10.5 load plugs differently. I had luck with programming eq , trim, autotune on slot 1 always. Then from there with a plugin only loaded on slot 1. Program the other plugs to come after. Tell each one to go to the second half shown slot and the rest will load one after another. Auxes, channels, stereo out need there own macro to load on inspector. 10.7 will load one after another when programming each one.

                Remove plugin the same with same command but wait for small red box to shows up on the right of plugin. Then tell it No Plug-in. Let me know if that helps at all.

                Ryan

                1. TTyler Falcone @Tyler_Falcone
                    2022-01-19 02:17:55.271Z

                    Hey Ryan, did. you have a template or script for this? I'm trying to be able to set up a bus with delay

                  • In reply toJon_Newell:
                    Kitch Membery @Kitch2024-03-13 22:48:39.958Z

                    Hi @Jon_Newell, @Ryan_Hayes @Tyler_Falcone.

                    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.