Our application has three contextmenu of the same name and only one of the menu is mapped so while running a script the active context menu is not called instead the mapped contextmenu is called
Take a look at the help topics on the various FIND methods. You can find your object based on known property values, iterate through an array of objects... Not sure the best solution for you.