Along with updates to my PFAssistive and PFEventTaps frameworks for Mavericks, I have posted a free developer utility with source code called "Accessibility Testbench." You can download the Xcode 5.0.1 project from the Frameworks page at <http://http://pfiddlesoft.com/frameworks/> or at the end of a "Note on Security Issues Presented by Assistive Applications" at <http://http://pfiddlesoft.com/frameworks/support.html>.
By now, just about everybody writing assistive applications knows that Mavericks no longer allows users to enable access globally or programatically. Instead, the user must grant access to each application separately, and it can only be done by the user manually in the Privacy pane's Accessibility list in Security & Privacy preferences. Mavericks automatically presents a built-in system access alert as a modal alert when an assistive application attempts to use an accessibility function. The alert includes a button to open System Preferences, and clicking it opens System Preferences to the Accessibility list and automatically adds the application to the list. The user must still select the application's checkbox in the list manually, after authenticating with an administrator password to unlock Security & Privacy preferences.
Accessibility Testbench is at this point a limited application. Its primary purpose is to demonstrate how an assistive application running under Mavericks can suppress the built-in system access alert and instead post a custom alert sheet at launch or afterwards to help the user grant or deny access. A sheet is useful for single-window "shoebox" applications and multi-window applications that do non-accessibility things in other windows, but the code can easily be modified to present a modal alert if preferred. Another important benefit is that you can use custom wording in your sheet or alert. And, of course, it opens System Preferences to the Accessibility list for the user, just like the built-in system alert.
In addition, Accessibility Testbench shows you how to be notified when the user grants or denies access to your application in Security & Privacy preferences, in case you want to respond by posting an alert or changing the UI of your application (for example, by enabling and disabling buttons for tasks that require access).
Finally, Accessibility Testbench shows you how to reset the Accessibility list by denying access to all assistive applications at once. This is useful to developers so they can repeatedly test their assistive applications as if they were running for the first time on a computer with access disabled. It may also be useful for computers that are located in an insecure environment, such as a school computer lab. |