title: Objective-C: get detailed menu information from external application
body: <p>This question (<a href="https://stackoverflow.com/questions/11444033/objective-c-get-menu-information-from-external-application">Objective-C: get menu information from external application</a>) 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:</p>
  
  <pre><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);
      }
  }
  </code></pre>
  
  <p>And get the menu details?</p>