How Click Menubar MenuItem and Leave it Open?

I want to click a menubar menu item and leave it open (specifically, the Window menu; preferably of whatever application is frontmost, but a Safari-specific solution is the first thing I need). The obvious GUI scripting doesn’t work, unless I am making a particularly dumb mistake. Any ideas/solutions?

A macro using the Select Or Show A Menu Item action configured only with Menu Title: Window seems to work (I tested in Safari, bit no obvious reason it shouldn’t work elsewhere).

2 Likes

Peter added this little winner to Keyboard Maestro 6.

-ccs

Is this what you mean?

Doesn't do anything in a macro containing just that action.

That’s exactly what I tested and the Window menu was left displayed. Maybe I’m misunderstanding what you’re trying to do?

What you describe is what I am trying to do, but it is not what happens with the macro I showed.

It doesn't work with Front Application either:
Keyboard Maestro “Select or Show a Menu Item” Action

[OS X 10.11]

That’s exactly the macro I just set up and the Window menu displays for me here. I’m also running 10.11 (.6). I activated the macro using a Hot Key Trigger.

I have no idea why I would be seeing one result and you another.

My macro had resided in a Safari-specific macro group. Moving it to the Global Macro Group still worked, whether in built-in applications (Mail, Messages, Safari) and in older applications like Excel 2011.

Thanks for testing. Quite a mystery. And I should have mentioned in my OP that I had tried this along with GUI scripting.

Just in case… You don’t perhaps have a space in your menu title, do you? As in, "Window ".

To at least resolve getting this in Safari, a macro using the Move Or Click Mouse action should work since the Window menu title doesn’t move. Of course, this doesn’t help in other applications where the menu is likely to be in a different location.

Sounds like weird things are going on for you.

Things to check/try:

  • I assume you are using a recent version of Keyboard Maestro (7.x)?
  • It sounds like Accessibility is failing.
    • Does any Select Menu Item work?
  • Have you tried restarting?

Hey Mitchell,

I’ve been using a macro like that for years and it works just fine on macOS 10.11.6.

If you can’t get this working after following Peter’s advice then please post your complete macro for us to test.

-Chris

A variation on this.

In Apple Mail, I want to select a mail item in the inbox, click on a palette item that then exposes the "move to" submenu of the Message menu with the cursor placed within that submenu so I can select an item within that submenu.

This fails as exposing the submenu by clicking on a palette item leaves the cursor located at the palette and when moved off the palette towards the submenu, the exposed submenu collapses.

I suppose I could set up a series of clicks at the menu bar location of the menu item, then at the location of the "move to" item within that menu, then to some location within the submenu, and add pauses as needed...

Any better/less UI hacking way to expose and get the cursor within that submenu and paused for user input?

MacOS12.2.1/KM 10.0.2