The PFAssistive framework is an Objective-C wrapper for Apple's accessibility API. It enables you to use familiar Cocoa techniques to write assistive applications for persons with disabilities as well as other applications that monitor and control User Interface elements in any application running on the computer.

The accessibility API is a set of C header files located in the HIServices subframework of the macOS ApplicationServices framework. The API was introduced in Mac OS X 10.2 (Jaguar) and is installed by default on every Macintosh computer running Jaguar or later. See Apple's ApplicationServices Framework reference document and, if you can find it, the old Apple Accessibility (ApplicationServices/HIServices) Reference and its Accessibility Roles and Attributes Reference for documentation of the C API, and the Accessibility Programming Guide for OS X and NSAccessibility Protocol Reference for documentation of the method-based NSAccessibilityProtocol introduced in OS X Yosemite 10.10.

All standard UI elements in Cocoa and Carbon applications are prewired to support the accessibility API. Custom elements in an application may have been written to support the accessibility API, as well. However, some applications use custom elements that do not support the accessibility API.

The PFAssistive framework is brought to you by PFiddlesoft. You can see it in use by downloading the free 30-day trial version of UI Browser, available at pfiddlesoft.com/uibrowser/. The framework has been the engine underlying UI Browser since UI Browser was introduced in 2003. The PFAssistive framework automatically works around all known accessibility API bugs. It is designed to make the accessibility API work seamlessly with applications based on Apple's Cocoa frameworks, using convenient Objective-C techniques such as delegate methods.

Sample code in the form of a simple screen reader is provided with the framework.

This documentation is written for version 3.9.0 of the framework. This version requires Mac OS X 10.7 (Lion) or later, and it supports accessibility features introduced through macOS Mojave 10.14. It is a universal binary supporting clients that run natively on Intel processors using a 64-bit architecture with reference counted memory management or ARC. It supports clients that are written in Objective-C or Swift.

Public methods in the framework, unless otherwise noted, take Objective-C objects as parameters and, when they return Objective-C objects, return them autoreleased. Unless otherwise noted, methods with return values return nil, NULL, 0, or NO in the event of an error. New Objective-C features such as generics and nullability annotations are included.

The framework uses CFTypeRef-style Core Foundation structures internally, particularly the accessibility API's AXUIElementRef and AXObserverRef. The framework contains a few public methods that return CFTypeRef-style structures. All such structures are returned CFRetained.

The two most important classes in the framework are PFUIElement and PFObserver. The PFUIElement.h header covers the part of the accessibility API that monitors and controls user interface elements in running applications, such as menus, windows, and buttons. The PFObserver.h header covers the part of the accessibility API that observes user interface elements in running applications and receives notifications in real time when changes occur.

The PFAssistive Framework is copyrighted software. See the licenses embedded in the framework bundle for applicable terms and conditions of use.



Headers

PFObserver
PFUIElement

Functions

+[ PFApplicationUIElement applicationUIElementClassForPid: ]
+[ PFObserver observersForPid: ]
-[ PFUIElement existsAttribute: ]
+[ PFApplicationUIElement applicationUIElementWithBundleIdentifier:delegate: ]
+[ PFObserver observersForURL: ]
-[ PFUIElement existsNonParameterizedAttribute: ]
+[ PFApplicationUIElement applicationUIElementWithPath:delegate: ]
+[ PFObserver observerWithBundleIdentifier: ]
-[ PFUIElement existsParameterizedAttribute: ]
+[ PFApplicationUIElement applicationUIElementWithPid:delegate: ]
+[ PFObserver observerWithBundleIdentifier:notificationDelegate:callbackSelector: ]
-[ PFUIElement existsValueForAttribute: ]
+[ PFApplicationUIElement applicationUIElementWithURL:delegate: ]
+[ PFObserver observerWithName: ]
+[ PFUIElement firstElementWithRole:inArray: ]
-[ PFApplicationUIElement elementAtIndexPath: ]
+[ PFObserver observerWithName:notificationDelegate:callbackSelector: ]
-[ PFUIElement indexAmongLikeElementsInArray: ]
-[ PFApplicationUIElement elementAtPoint: ]
+[ PFObserver observerWithPath: ]
-[ PFUIElement indexPath ]
-[ PFApplicationUIElement initSystemWideWithDelegate: ]
+[ PFObserver observerWithPath:notificationDelegate:callbackSelector: ]
-[ PFUIElement initWithElementRef:delegate: ]
-[ PFApplicationUIElement initWithBundleIdentifier:delegate: ]
+[ PFObserver observerWithPid: ]
-[ PFUIElement invalidate ]
-[ PFApplicationUIElement initWithPath:delegate: ]
+[ PFObserver observerWithPid:notificationDelegate:callbackSelector: ]
+[ PFUIElement isAccessEnabled ]
-[ PFApplicationUIElement initWithPid:delegate: ]
+[ PFObserver observerWithURL: ]
+[ PFUIElement isAccessImplemented ]
-[ PFApplicationUIElement initWithURL:delegate: ]
+[ PFObserver observerWithURL:notificationDelegate:callbackSelector: ]
-[ PFUIElement isDestroyed ]
-[ PFApplicationUIElement pidNumber ]
-[ PFObserver pidNumber ]
-[ PFUIElement isEqualToElement: ]
+[ PFApplicationUIElement registerUIElementClass:forPid: ]
-[ PFObserver registerForNotification:fromElement:contextInfo: ]
-[ PFUIElement isParameterizedAttribute: ]
+[ PFApplicationUIElement systemWideUIElementWithDelegate: ]
-[ PFObserver registrations ]
+[ PFUIElement isProcessTrusted ]
-[ PFApplicationUIElement typeCharacters:keyCode:withModifierFlags: ]
+[ PFObserver removeObserversForBundleIdentifier: ]
+[ PFUIElement isProcessTrustedWithOptions: ]
+[ PFApplicationUIElement typeCharactersSystemWide:keyCode:withModifierFlags: ]
+[ PFObserver removeObserversForPath: ]
-[ PFUIElement isRole: ]
+[ PFApplicationUIElement UIElementClassForPid: ]
+[ PFObserver removeObserversForPid: ]
-[ PFUIElement isSettableAttribute: ]
-[ PFObserver delegate ]
+[ PFObserver removeObserversForURL: ]
-[ PFUIElement isSiblingOfElement: ]
-[ PFObserver description ]
-[ PFObserver setDelegate: ]
-[ PFUIElement isValid ]
-[ PFObserver initForInfoWithBundleIdentifier: ]
-[ PFObserver unregisterForAllNotifications ]
-[ PFUIElement isVisibleAtPoint: ]
-[ PFObserver initForInfoWithBundleIdentifier:notificationDelegate:infoCallbackSelector: ]
-[ PFObserver unregisterForAllNotificationsFromElement: ]
-[ PFUIElement nonParameterizedAttributes ]
-[ PFObserver initForInfoWithPath: ]
-[ PFObserver unregisterForNotification:fromElement: ]
+[ PFUIElement notificationDefinitions ]
-[ PFObserver initForInfoWithPath:notificationDelegate:infoCallbackSelector: ]
+[ PFObserverDelegate applicationWithIdentifier:atPath:didPostAccessibilityNotification:fromObservedUIElement:forAffectedUIElement: ]
-[ PFUIElement notifications ]
-[ PFObserver initForInfoWithPid: ]
+[ PFObserverDelegate applicationWithIdentifier:atPath:didPostAccessibilityNotification:fromObservedUIElement:forAffectedUIElement:withInfo: ]
+[ PFUIElement notifications ]
-[ PFObserver initForInfoWithPid:notificationDelegate:infoCallbackSelector: ]
+[ PFUIElement actionDefinitions ]
+[ PFUIElement notificationsForRole:andSubrole: ]
-[ PFObserver initForInfoWithURL: ]
-[ PFUIElement actions ]
-[ PFUIElement parameterizedAttributes ]
-[ PFObserver initForInfoWithURL:notificationDelegate:infoCallbackSelector: ]
+[ PFUIElement actionsForRole:andSubrole: ]
-[ PFUIElement parentIndexPath ]
-[ PFObserver initWithBundleIdentifier: ]
-[ PFUIElement activateApplication ]
-[ PFUIElement parentPath ]
-[ PFObserver initWithBundleIdentifier:notificationDelegate:callbackSelector: ]
-[ PFUIElement applicationElement ]
-[ PFUIElement path ]
-[ PFObserver initWithPath: ]
+[ PFUIElement attributeDefinitions ]
-[ PFUIElement performAction: ]
-[ PFObserver initWithPath:notificationDelegate:callbackSelector: ]
-[ PFUIElement attributedStringFromAXAttributedString: ]
-[ PFUIElement pid ]
-[ PFObserver initWithPid: ]
-[ PFUIElement attributes ]
+[ PFUIElement roleDefinitions ]
-[ PFObserver initWithPid:notificationDelegate:callbackSelector: ]
+[ PFUIElement attributesForRole:andSubrole: ]
-[ PFUIElement setDelegate: ]
-[ PFObserver initWithURL: ]
-[ PFUIElement childrenCount ]
-[ PFUIElement setElementInfo: ]
-[ PFObserver initWithURL:notificationDelegate:callbackSelector: ]
-[ PFUIElement clippedRect ]
-[ PFUIElement setElementRef: ]
-[ PFObserver invalidate ]
-[ PFUIElement countForAttribute: ]
-[ PFUIElement setExists: ]
-[ PFObserver isEqualToObserver: ]
-[ PFUIElement delegate ]
-[ PFUIElement setMessagingTimeout: ]
-[ PFObserver isRegisteredForNotification:fromElement: ]
-[ PFUIElement description ]
-[ PFUIElement setValue:forAttribute: ]
-[ PFObserver isValid ]
-[ PFUIElement descriptionForAction: ]
-[ PFUIElement typeForAttribute: ]
+[ PFObserver observerForInfoWithBundleIdentifier: ]
-[ PFUIElement descriptionForAttribute: ]
+[ PFUIElement UIElementWithElementRef:delegate: ]
+[ PFObserver observerForInfoWithBundleIdentifier:notificationDelegate:infoCallbackSelector: ]
+[ PFUIElement descriptionForNotification: ]
-[ PFUIElement valueForAttribute: ]
+[ PFObserver observerForInfoWithPath: ]
-[ PFUIElement descriptionForSubrole: ]
-[ PFUIElement valueForAttribute:atIndex: ]
+[ PFObserver observerForInfoWithPath:notificationDelegate:infoCallbackSelector: ]
-[ PFUIElement descriptionOfTypeForAttribute: ]
-[ PFUIElement valueForAttribute:parameter: ]
+[ PFObserver observerForInfoWithPid: ]
+[ PFUIElement elementAtPoint:withDelegate:error: ]
-[ PFUIElement valuesForAttribute:range: ]
+[ PFObserver observerForInfoWithPid:notificationDelegate:infoCallbackSelector: ]
-[ PFUIElement elementInfo ]
-[ PFUIElement valuesForAttributes: ]
+[ PFObserver observerForInfoWithURL: ]
-[ PFUIElement elementRef ]
+[ PFUIElementDelegate PFUIElementReportError: ]
+[ PFObserver observerForInfoWithURL:notificationDelegate:infoCallbackSelector: ]
+[ PFUIElement elementsWithRole:inArray: ]
+[ PFUIElementDelegate PFUIElementWasDestroyed: ]
+[ PFObserver observersForBundleIdentifier: ]
-[ PFUIElement exists ]
+[ PFObserver observersForPath: ]
-[ PFUIElement existsAction: ]