I need help selecting a menu item from a right-click menu, aka context menu. I want to make a script that can right-click on 2 different kinds of objects, detect what type of object they are based on the context menu that appears and select an appropriate item from the menu.
Specifically, I need to select either "Properties - Super-module" or "Properties - Module" depending on which one shows up after right-clicking. Of course these 2 items are in different positions and have different short-cut keys, so there is no one-size-fits-all option.
I saw commands for working with the menu bar menus, e.g. WinMenuSelectItem, but nothing to work with right-click menu.
Any ideas?