Found image issue

I'm trying to program KM to select some sub-sub-sub menu items in a pulldown, and after trying using KM's record, it wasn't recognizing the pulldown, so I had to do it using Found Image.

See the screenshot below. I successfully told it to move the mouse to the original pulldown (not visible but called "Unassigned"). KM clicks there, then looks for the image "Insert Settings" which works correctly. Next it's supposed to look for the image of "Pianos and Rhodes" -- however no matter what I do (including putting a 1 second pause before it) it won't find that image properly.

40%20PM

Here is a screenshot of (part of) the KM macro. The first two found image routines work fine. The third one doesn't work, no matter what I try.

19%20PM

I'm sure the problem does not have to do with the blue highlight from the first screenshot. The blue highlight doesn't appear until the mouse moves over a selection, so I made sure to take all my screenshots without the blue highlight.

Any suggestions?

Is this a menu system that's navigable via keystrokes (down arrow and right arrow)? If so, and assuming the menu contents don't change, that's a better way to get more consistent KM results. You can also substitute letters (initials of menu items) to skip some of the down arrows.

In this case you would actually be better off using macOS's native keyboard assignment.

System Preferences -> Keyboard -> Shortcuts (tab) -> App Shortcuts

Add the app, and then the exact menu item name, and assign your keyboard shortcut there.

I agree with johns, if you only ever want to choose that same menu item. However, it's sometimes useful to set up a KM macro to navigate to a particular submenu with arrow keys, leaving the last submenu hanging, thereby allowing the user to navigate the final submenu with up/down arrows to make the final choice.

Have you tried using the KM Select or Show a Menu Item action?
I use it a lot, and find it very reliable.

I used to use the macOS Keyboard Prefs to set shortcuts, but I have found easier to manage all of my shortcuts in KM.

Thanks all for the replies.

I could not get Select or Show a Menu Item action to work.

I never solved why the Found Image wasn't working.

But I did realize the pulldown reacts intelligently to arrow keys and to typing the first characters of what I want. So I've redone the macro using keystrokes.

I'd still love to know why Found Image wasn't working because, even though I realize that's typically the last resort, sometimes it's the only way, particularly in apps that use custom widgets.