Selecting a Menu Item Using a Variable

This should only be an issue if you were using a regular expression and not a literal string...

Keeping in mind that I'm not very adept at KM, I'm not sure if I'm using a regular expression or a literal string.

"LogicPro_RegionName" is a variable that gets set in the following way:

a. I manually select an audio clip within Logic Pro—which is my audio editing app.
b. In my macro there's an action that copies the name of the audio clip that I select above and puts it inside the "LogicPro_RegionName" variable.
c. Later in the macro there's also a "Search and Replace System Clipboard Using Regular Expression" action that GREPs "LogicPro_RegionName" to remove some numbers at the end that get added by Logic Pro.
d. And later in the Macro there are more actions that switch over to another app and then select a Menu item that matches "LogicPro_RegionName"

Hope that answers your question :slight_smile:

Apparently you are changing the menu name string such that it can no longer match as a literal string using the Select or Show a Menu Item action.

By adding the caret (^) to the beginning of the field you alter it from a literal into a regular expression that will match a menu item containing your saved menu name.

1 Like

Similar problem, only in reverse.

I want to select this menu item, regardless of the number at the start of its name.

I've tried .*Regions as Audio Files…, with no luck. Any suggestions?

My current workaround is:

Did you put ^ at the start of your regex?

1 Like

You know what, I did try that and it didn't work. Just tried again and it did! I think it might be one of those finnicky Logic things where the menu items aren't updated until actually displayed... Thanks @tiffle

1 Like