I think this may be of interest but you still need to know the top-level ID number, if you wish to apply it for something other than plugins.
The top-level ID numbers are as follows.
Menu Item: &Help, ID: 1
Menu Item: &File, ID: 2
Menu Item: &Edit, ID: 3
Menu Item: &Layer, ID: 4
Menu Item: T&ype, ID: 23
Menu Item: &Select, ID: 7
Menu Item: Fil&ter, ID: 6
Menu Item: &View, ID: 9
Menu Item: Plugins, ID: 7200
Menu Item: &Window, ID: 8
This mostly works for me but I wish to be able, for example, to navigate to the Color Transfer option in the Neural Filters section but I cannot work out how to do that, let alone programmatically select options and run the filter.