-1

I'm writing an application that allows access to other applications' menu items via the accessibility framework. I have no problem obtaining the list of menus, their menu items, etc..

As far as I can see, however, the accessibility framework does not give access to the keyboard shortcuts for each item.

More concretely, if my app presents the Finder's File -> New Finder Window menu item, I would like to annotate it on screen with Command-N, so the user can learn the shortcuts by heart.

At the moment I see no way of getting that information. If not via the AXUIElement accessibility framework, how else can one get that info?

Any help would be much appreciated.

Frank R.
  • 2,328
  • 1
  • 24
  • 44
  • Which attributes do you use, do they have "menuitem" siblings? Have you tried `AXUIElementCopyAttributeNames`? – Willeke Jan 05 '22 at 15:36
  • Could you please share how you read "obtaining the list of menus, their menu items, etc"? Thanks in advance. – chunyang.wen Feb 24 '23 at 13:59

1 Answers1

0

I have managed to find AXMenuItemCmdChar and associated AXUIElement attributes that actually have the information I'm after. Unfortunately, the Swift framework that I use to bridge the C-level Carbon accessibility APIs defines a convenient enum for all the attributes.. only it's not quite all the attributes :-(

Frank R.
  • 2,328
  • 1
  • 24
  • 44