For detailed instructions and sample code showing how to use the PFiddlesoft Frameworks, download our Assistive Application Programming Guide for macOS. Also download the PFAssistive Framework Reference and the PFEventTaps Framework Reference for detailed documentation of all of the frameworks' classes, protocols, properties and methods. The Programming Guide is also included in both downloadable framework disk images along with its detailed framework reference.
Download the SimpleScreenReader 1.4.0 source code for sample code showing how to use the PFAssistive Framework.
A Note on Security Issues Presented by Assistive Applications
Assistive applications give computer users with disabilities full access to the power and benefits of modern computer hardware and software. An assistive application running on macOS uses Apple's Accessibility and Quartz Event Taps APIs to enable the user to explore, monitor and control the computer, including other running applications, using Accessibility features built into the system without requiring a mouse, a keyboard or other conventional input devices.
Assistive applications serve an important public purpose, promoted by the requirements of Section 508 of the Workforce Investment Act of 1998 regarding access to electronic and information technology for persons with disabilities. Compliance with Section 508 is a prerequisite for sale of computer and other products to the federal government and to many state agencies and educational institutions.
At the same time, the extraordinary power of the accessibility features built into macOS presents potential security issues, which Apple has addressed in a variety of ways since the Accessibility API was introduced in Mac OS X v10.2 Jaguar. Chief among Apple's security precautions, Accessibility is turned off by default on all Macintosh computers. To use an assistive application, a user must deliberately enable access allowing the assistive application to use Accessibility features, and authentication with an administrator password is required.
In Mac OS X 10.7 (Lion) and OS X Mountain Lion 10.8, the user enabled access globally for all applications by selecting the "Enable access for assistive devices" checkbox in Accessibility (or Universal Access) preferences. In most assistive applications, a dialog advises the user to open System Preferences, go to the indicated preferences pane, and manually select the checkbox. Some assistive applications open the preferences pane for the user, while a few others enable access for the user automatically using a relatively little-known AppleScript command, but authentication with an administrator password is still required. A very small number of assistive applications—including PFiddlesoft's UI Browser—used a per-application trust mechanism in Lion and Mountain Lion that was difficult to implement but as easy on the user as the AppleScript technique. It provided greater security by allowing users to leave the global access setting turned off, and authentication was still required.
Security has been tightened in OS X Mavericks 10.9 and newer. Apple removed the global access feature from Accessibility preferences and introduced a new per-application trust mechanism. In addition, the AppleScript technique for enabling access programmatically was eliminated by making the relevant properties read-only. Access can now be authorized only for individual applications, and the user must do it manually by selecting each application's checkbox in the Privacy pane's Accessibility list in Security & Privacy preferences. The new trust mechanism is very easy for assistive application developers to implement. While it is a little more difficult for users, they do reap the benefits of increased security. The difficulty is ameliorated as much as possible by a built-in system alert that offers to open System Preferences for the user, automatically adding the assistive application to the Accessibility list and bringing it to the front so the user can select the appropriate checkbox—after authenticating with an administrator password to unlock Security & Privacy preferences.
To assist developers in adapting to the new Mavericks security mechanism, PFiddlesoft has written two free developer utilities and posted the source code for examination. One, Accessibility Testbench, is available for download on the Accessibility Testbench page. It uses raw Accessibility API functions and does not require PFAssistive Framework. The other, PFAssistive Testbench, is identical in functionality but embeds our PFAssistive Framework and uses one of its methods. It can be downloaded here as PFAssistive Testbench source code. Download either of them and study the code to learn how your assistive application can present alert sheets in Mavericks or newer with customized wording, instead of using the fixed, freestanding modal alert presented by the system. In addition, learn how your assistive application can be notified and respond appropriately when the user grants or denies access in Security & Privacy preferences. Finally, both utilities include a routine that resets the Accessibility List so that developers can repeatedly test their assistive applications as if they were being launched for the first time on the computer.