This question (Objective-C: get menu information from external application) shows how to get the top-level menu items for an external application on OS/X. But it doesn't show how to iterate down into lower-levels of the menus. It also doesn't show how to get the shortcut keys for those menu items that have them. I've played around with the code but my ignorance of Objective-C is holding me back. How do I take this code:
SystemEventsApplication* sevApp = [SBApplication applicationWithBundleIdentifier:@"com.apple.systemevents"];
SystemEventsProcess* proc = [[sevApp applicationProcesses] objectWithName:appName];
for (SystemEventsMenuBar* menuBar in proc.menuBars) {
for (SystemEventsMenuBarItem* menuBaritem in menuBar.menuBarItems) {
NSLog(@"%@", menuBaritem.name);
}
}
And get the menu details?