Select submenu item with the same name

Hi, can you tell me how to create shortcut to select menu item when submenu has the same name like sibling (which located before called item)?

@adubrov - I've run into situations, like this, but I won't put up a fight trying to make Keyboard Maestro fix every application design issue - although it does well in that department. Since I don't have Sketch, I'll propose two solutions that may work:

  1. If it allows such, I'd create a custom shortcut within the preferences of the specific action (in this case Sketch). Then I'd use Keyboard Maestro to use that shortcut in whatever macro you are using.

or

  1. I'd use the Keyboard - Shortcuts - App Shortcuts section within System Preferences and
    create the specific App Shortcut for that menu selection.

See if one of those proposed solutions work.

KC

1 Like

Thanks for your reply.

Did it help you solve the issue?

This AppleScript works:

image

-- Use this script as a wrapper for GUI Scripting statements when you are confident that GUI Scripting is available and enabled or that the user knows how to enable it if necessary

activate application "Sketch"
tell application "System Events"
	tell process "Sketch"
		-- insert GUI Scripting statements here:
		click menu item 8 of menu 1 of menu item 27 of menu 1 of menu bar item 11 of menu bar 1
	end tell
end tell
3 Likes

I don't have Sketch for testing. However, in terms of utilizing Keyboard Maestro, if the Sketch app is running, can the Show All Guides menu item be selected if using the Select Or Show A Menu Item that Keyboard Maestro offers, specifically by using the menu noted in the image below which should then specifically target that?

image

Thank you very much.
Just one question, where did the numbers 27 and 8 come from?
I counted 19 and 6, or is it some kind of id?

I usually do this, but it didn't work in this case.

Yes, thank you, this option is working, I just wanted to keep everything in one place – in super useful app Keyboard Maestro.

used the UI Browser app to get that information