Logic Pro: Copy a Menu Item Name to a Variable

I'm trying to copy the name of a plugin in Logic Pro to a variable. It shows up both as a menu item in a drop down menu and as a string near the very bottom of the window, but I would prefer not to use OCR. The discussion about this here: Long Shot: Copy Logic Pro Plugin Name to Clipboard? was somewhat helpful and I think the idea of saving a preset that has the name of the plugin (which then becomes a menu item) works for me.

The only problem Is, I can't seem to figure out the proper AppleScript to get the name out of the menu.

This is what I can find with the other System Events Analysis macros on this forum. The menu item "$AIRReverb_x64" is the string I'd like to have stored in a variable, but I can't figure out the code for it. I've tried a lot of variations of telling the menu "VT VERB" (which is a menu that appears when I click a found image at a pop up button) to return its menu items and can't seem to get a single one. How would you all go about getting "VT VERB" to return that menu item name via AppleScript?

application Process "Logic Pro X"
window VT VERB
button 1
button 2
checkbox 1
menu button "Editor"
pop up button 1
static text "Side Chain:"
checkbox " "
checkbox "Compare"
group 1
button 1
button 2
pop up button 2
UI element 11
static text "VT VERB"
menu "VT VERB"
menu item "Setting"
menu item 2
menu item "Undo"
menu item "Redo"
menu item "Include Plug-in Undo Steps in Project Undo History"
menu item 6
menu item "Next"
menu item "Previous"
menu item 9
menu item "Copy"
menu item "Paste"
menu item 12
menu item "Load…"
menu item "Save"
menu item "Save As…"
menu item "Save A Copy As…"
menu item "Save As Default"
menu item "Recall Default"
menu item "Delete"
menu item 20
menu item "$AIRReverb_x64"
menu item "AU Presets"
menu "AU Presets"
menu item "Pres 0: default"

I too would have preferred other methods over OCR, but in this case I do think it's the most efficient solution.

Get Plugin Name.kmmacros (26 KB)

Macro screenshot

This works very well, but many plugin windows opened on a laptop have their bottom area off-screen. All of the window positioning actions / scripts that I know of which work in other applications don't seem to function reliably on these plugin windows. Sometimes KBM seems to be able to move them by pixels, sometimes it can't. I can't seem to set their positions via Script or KBM actions. Any thoughts?

Apple changed the format of plugin windows in Logic 10.7 and they don't play as nicely as they used to with Keyboard Maestro, I'm afraid.

What are you ultimately trying to do here that requires grabbing the plugin name?

1 Like

At the end of projects or in the event I have to move over a project it would be helpful to save my plugin settings across lots of tracks and plugins. I want to save the aupresets in a specified folder with a filename that includes the plugin name, the track name, and the project name.

Perhaps it would be easier to grab the plugin name from the folder it brings up on Save As.

Interesting. I personally prefer to import channel strips if and when I need them, as it makes manual preset management unnecessary. Is that no good for your workflow? I suppose if you archive sessions where they're not readily accessible this might not be a good option.

It looks like that's going to be a lot simpler for archival purposes, and Keyboard Maestro can handle it with chains of key commands for the most part.

Being able to scrape the plugin name while saving a preset did dovetail with my overall desire to have some kind of more universal preset browsing, but there's probably better ways to implement that.

I might not have articulated what I mean very well. I import channel strips from existing sessions using Logic's file browser. I don't save channel strips at all.

Say I want to recreate a vocal sound I had on another project, I navigate to it in the browser and import the plugins (not the content/automation etc). Then it's just a question of gain staging.

It might not be for you but it's just another option to consider that requires no foresight.

It's worth considering and I'm glad you mentioned it for other people here.

I personally find that option to be slow due to: 1) Getting the project on my hard drive from the cloud. 2) The slow speed at which it loads the project in the background to import content. 3) Dealing with compatibility or stability issues that can come up from it loading old projects in the background.

Thanks for the help and for posting your OCR example! I'm going to proceed with the Channel Strip saving option and mark your reply about windows issues in Logic 10.7+ as the solution. The scripts and actions I was using seemed to work well in other programs, just not Logic.

1 Like

Ah yeah. If your sessions are in the cloud, that's not the one. If you need any help going forward, let me know. Always happy to get involved with anything related to Logic. :+1:t3:

1 Like