osx - Objective-C: get menu information from external application -


I am trying to write additional applications in a Mac OS menu that displays an active menu that contains the currently active application The menu bar items are, when the user presses some hotkey, I can fix the contextual menu, but I can not currently get menu item of the active application. At the moment I get the name of the active applications to use the [[NSWorkspace sharedWorkspace] running applications] Filtered Horizons Used:] , but NSRunningApplication contains a lot of other valuable information . Either way, can I get information about the application menu from an external application?

Update:

Using a framework works great, if you are happy using 'Apple Script: < Pre> system events application * sevApp = [SBApplication application with bundle identifier: @ "com.apple.systemevents"]; SystemEventsProcess * proc = [[sevApp application process] objectWithName: appName]; (Proc.menuBars in SystemEventsMenuBar * menuBar) {{Menu in SystemEventsMenuBarItem * menuBaritem menu.BannerMarItems} {NSLog (@ "% @", menuBaritem.name); }}

will print a list of available menus from the application's menu bar There is no way to get the relevant menu, so I do not answer it yet ...

It was also helpful:

You can use the menu item shown to imitate, but I'm not sure that it is possible to dynamically capture the names of all menu items. You already need to have hardcoded names in the app The issuer.

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -