Can't seem to figure out how to make this happen... Is there any insight someone could point me to? Thanks!
- Kitch Membery @Kitch2020-12-26 21:54:03.636Z
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();
- TThe Canvas Group @The_Canvas_Group
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?
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.
- TThe Canvas Group @The_Canvas_Group
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).
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 :-) ).
- TThe Canvas Group @The_Canvas_Group
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.
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!
- In reply toThe_Canvas_Group⬆:
Kitch Membery @Kitch2020-12-29 20:12:26.540Z
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();
- TThe Canvas Group @The_Canvas_Group
You're a legend, mate. Thank you. And thak you for being so open with your knowledge.
Kitch Membery @Kitch2020-12-29 21:18:23.706Z
No worries mate. My pleasure. :-)
- In reply toThe_Canvas_Group⬆:
Kitch Membery @Kitch2020-12-30 02:51:01.373Z
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();
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- DDan Radclyffe @Dan_Radclyffe
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!
- In reply toKitch⬆:DDan Radclyffe @Dan_Radclyffe
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)
- DDan Radclyffe @Dan_Radclyffe
@Kitch ignore me. It totally works to copy and paste the script!
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.
- DDan Radclyffe @Dan_Radclyffe
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
Hot damn. This is great.
Kitch Membery @Kitch2020-12-30 20:51:55.417Z
Hahahah :-) Rock on!
- TThe Canvas Group @The_Canvas_Group
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.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- TThe Canvas Group @The_Canvas_Group
This one is DEFINITELY useful.
2 Questions:
-
Is there a script that changes software-instruments outputs to different outputs that I missed?
-
Is there a script that sends to designated sends?
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 :-)
-
- In reply toKitch⬆:TThe Canvas Group @The_Canvas_Group
And yeah, a preset chain command would be HUGE.
Especially if it's not something already built into a template.
- In reply toKitch⬆:DDan Radclyffe @Dan_Radclyffe
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.
):
- TThe Canvas Group @The_Canvas_Group
Massive up here, man.
Thank you.
- DIn reply toThe_Canvas_Group⬆:Dan Radclyffe @Dan_Radclyffe
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?
- DDan Radclyffe @Dan_Radclyffe
Just bumping this in case anyone can help out?
- DDan Radclyffe @Dan_Radclyffe
@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!
- RRyan Hayes @Ryan_Hayes
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
- DDan Radclyffe @Dan_Radclyffe
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!
- RRyan Hayes @Ryan_Hayes
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"], });
- DDan Radclyffe @Dan_Radclyffe
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", });
- RRyan Hayes @Ryan_Hayes
Hey Dan, Only works in Logic 10.7 and later. What version are you on?
- In reply toDan_Radclyffe⬆:RRyan Hayes @Ryan_Hayes
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"],
});- DDan Radclyffe @Dan_Radclyffe
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!
- JIn reply toThe_Canvas_Group⬆:Johan Nordin @Johan_Nordin
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
- RRyan Hayes @Ryan_Hayes
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",});
- JJohan Nordin @Johan_Nordin
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 elementAny idea what might be causing the error? Best, Johan
- RRyan Hayes @Ryan_Hayes
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", });
- JJohan Nordin @Johan_Nordin
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 elementAny ideas? :) Best, Johan
- RRyan Hayes @Ryan_Hayes
You on logic 10.7?
- JJohan Nordin @Johan_Nordin
No, Logic 10.6.2. :)
- RRyan Hayes @Ryan_Hayes
Ah Menus changed in 10.7. That would be why.
- OOscar Fogelstrom @Oscar_Fogelstrom
I am getting a similar error on Logic 10.7.2 (for both scripts).
"Could not open popup menu (Load plugin test: Line 8)"
- In reply toThe_Canvas_Group⬆: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. :-)