Menu item not being clicked

In Logic I can see that this option is available:

SCR-20240407-kclq

Yet when I run this macro, the menu item is not clicked

image

I added the Pause to see if the issue was that, but no luck. Even added another pause before the IF THEN action, no luck. Tried with both exists and is enabled, no luck.
I copied the words from the Select Menu action to avoid typos and extra spaces, etc, no difference.

I even added an extreme amount of pause time, but it doesn't make a difference:

image

Tried adding a notification to see if it's at least finding the menu item, but the notification isn't displayed so for some reason KM is not finding the menu item at all:

image

I tried looking for "New"...
image

image

and it worked...

EDIT: After changing the option to other menu items to test if there was something wrong with that particular menu item, it started working with "Hide Global Tracks".
EDIT 2: Never mind... not working again... so frustrating!

For some weird reason, sometimes it feels like Keyboard Maestro gets "clogged" and it needs multiple tries to "unclog"...
@peternlewis any tips to fix this? It gets so frustrating when this happens, because we think there's something wrong with the macro/action when in fact it's KM that's acting weird...

Hey Tiago (@alltiagocom):wave:

I don’t have Logic but the scenario you’re describing sounds familiar to me.

Maybe you have to first select the Global Tracks Menu and then the Hide Global Tracks Menu.

That means duplicate the Menu Action on your macro and clear out the field from the First one where you’ve put the Hide Command. Maybe add a little Pause between the two Menu Actions.

I’ve mentioned this just because of the fact that this could be a dynamic Menu - and for these you’ll have no other way as I described it here.

Edit:
Maybe it’s better to do it without the wrapping in an If Action that’s checking for that Menu Path.

Greetings from Germany

Tobias

It isn't Keyboard Maestro acting weird, it is Logic Pro and it's menu handling.

First, add a Log action (or something else) to confirm whether Keyboard Maestro is even trying to select the menu - log each side of the If Then Else action so you at least know whether the menu is being found or not. Otherwise you don't know what to even look at debugging.

Some applications, especially cross platform applications, do not necessarily update or even build their menu bar until the menu is selected with the mouse. When asked for the menus via the accessibility subsystem, the menus are either not there, or not currently correctly built for the context (eg, menus may be disabled or invisible when they should not be).

Options to force the application into updating its menus include:

  • Switch out and back to the application, and then use the Select Menu Item action.
  • Use the Show Menu variant (leave the item field blank) of the Select Menu Item action to show the menu item first, and then the Select Menu Item.
  • Simulate a click in the menu bar, and then use the Select Menu Item action.
  • Desperate measures, simulate a click in the menu bar, and then use arrows and typeahead (Insert Text by Typing) to select the menu item.
1 Like