Is it possible to inspect the main application menu of some already running application and execute commands from this menu? For example retrieve the whole main menu hierarchy of Safari and execute the File → New Tab command (by its name, not using the keyboard shortcut). I’m interested in an Objective-C solution.
Is it possible to inspect the main application menu of some already running application
Share
One way to do this is using the Cocoa Accessibility API
For example,