2

I'm developing an app for Mac OS X with Xcode 5 and I need to navigate through the buttons, radio buttons with the Tab key.

There's a way for navigate between buttons and all other controls by enabling this option in System Preferences:

enter image description here

…but I need to enable this programmatically for new users which doesn't have this feature enabled. How do I do that?

Kevin Chen
  • 994
  • 8
  • 24
Jesus
  • 8,456
  • 4
  • 28
  • 40
  • I’d still like to see this answered — not to foist it on unsuspecting users, but for scripts like my new computer set-up script that configures similar settings to my liking – Alan H. Jun 07 '16 at 19:53

1 Answers1

1

You can find out where the preference is stored on disk and change that file, but that is not a good idea. What if the user does not want Tab to cycle through all controls? And the implementation will be fragile: what if Apple changes the name of the plist key in a future release?

A better way is to use the OS X Accessibility API so that your app can access the user interface of other apps. (For security reasons, your app needs to prompt the user to enable accessibility through System Preferences.)

Kevin Chen
  • 994
  • 8
  • 24
  • Sorry for the necro-post - but can isee some code implementing this? – eraxillan May 26 '15 at 12:49
  • @Kevin Chen: The link you provided is dead. Can you please provide an update? – JS. May 23 '16 at 21:29
  • 1
    @JS. i couldn't find the same page so i linked to the general OS X accessibility page. the original one is [archived by internet archive](https://web.archive.org/web/20140603023748/https://developer.apple.com/library/mac/documentation/Accessibility/Conceptual/AccessibilityMacOSX/OSXAXModel/OSXAXmodel.html), though. – Kevin Chen May 25 '16 at 16:37