Trying to select an item from a context menu

I'm trying to select the item "Reload glossary" from a context menu in my Java app CafeTran Espresso:

Screenshot 2024-05-10 at 07.30.29

I've tried to use Keyboard Maestro's own keystroke action for the down arrow, but the strange thing was that the required number of repeats was 5 or 6. I couldn't pinpoint the reason for this.

So I tried to find an image of "Reload glossary", but I had no success with that either.

Now I'm trying to use an AppleScript to select "Reload glossary" in the context menu via the keystroke instruction. This doesn't work. Is this because it's a Java app? The alternative way (much like KM's own keystroke action), works. But I expect to have the same issue (5x or 6x ↓ required).

Can you select menu items by typing? If so, have the macro type "R" "E" "L" etc.

-rob.

Alas, no.

BTW: This technique is very common on Windows, but I can hardly ever use mnemonics on Mac ...

They should work automatically in any native Mac app, though they're not as good as in Windows when there are multiple similarly-named items in one menu. Try it in TextEdit or Safari, etc., and it should work very well.

Cross platform apps don't tend to use the native macOS menu structures, though, and wouldn't necessarily get the automatic support.

I assume the menu item highlights when it's selected via the down arrow? If so, maybe you could use an Until loop, with a single down arrow keystroke action (and maybe a slight pause), and the condition being the found image of the highlighted menu item? That should be easier for KM to see.

-rob.

1 Like