AXUIElement.h

Overview

See the Overview section above for header-level documentation.

Overview

Assistive applications use the functions defined in this header file to communicate with and control accessible applications running in macOS.

Each accessible user interface element in an application is represented by an AXUIElementRef, which is a CFTypeRef. AXUIElementRefs (like all CFTypeRefs) can be used with all the Core Foundation polymorphic functions, such as CFRetain, CFRelease, and CFEqual.

All functions defined in this header file return kAXErrorSuccess on success. If there is some sort of system memory failure, such as the failure to allocate an object, all functions can return kAXErrorFailure. In the unlikely event that some process does not fully support the accessibility API, a function can return kAXErrorNotImplemented.

In addition, some functions can return the following error codes:

kAXErrorInvalidUIElement

The passed-in AXUIElementRef is invalid. All functions that include an AXUIElementRef parameter can return this error code.

kAXErrorIllegalArgument

At least one of the arguments is illegal (for example, NIL passed in for a pointer).

kAXErrorCannotComplete

There is a problem with messaging (such as when messaging to the server fails or when the accessible application is unresponsive or waiting for user input). All functions that perform messaging can return this error code.

kAXErrorAPIDisabled

The accessibility API is disabled. All functions that perform messaging can return this error code.

For more information on the definition and use of accessibility objects and in macOS accessibility support in general, see Accessibility Programming Guide for OS X.

Included Headers

  • <AvailabilityMacros.h>

  • <CoreFoundation/CoreFoundation.h>

  • <ApplicationServices/ApplicationServices.h>

Topics

Notification API

AXObserverAddNotification

Registers the specified observer to receive notifications from the specified accessibility object.

AXObserverCreate

Creates a new observer that can receive notifications from the specified application.

AXObserverCreateWithInfoCallback

Creates a new observer that can receive notifications with an information dictionary from the specified application.

AXObserverGetRunLoopSource

Returns the observer's run loop source.

AXObserverGetTypeID

Returns the unique type identifier for the AXObserverRef type.

AXObserverRemoveNotification

Removes the specified notification from the list of notifications the observer wants to receive from the accessibility object.

Miscellaneous

AXAPIEnabled

Returns whether the accessibility API is enabled.

Deprecated
AXIsProcessTrusted

Returns whether the current process is a trusted accessibility client.

AXIsProcessTrustedWithOptions

Returns whether the current process is a trusted accessibility client.

AXMakeProcessTrusted

Attempts to make the process represented by the specified path a trusted accessibility client.

Deprecated
AXUIElementCopyActionDescription

Returns a localized description of the specified accessibility object's action.

AXUIElementCopyActionNames

Returns a list of all the actions the specified accessibility object can perform.

AXUIElementCopyAttributeNames

Returns a list of all the attributes supported by the specified accessibility object.

AXUIElementCopyAttributeValue

Returns the value of an accessibility object's attribute.

AXUIElementCopyAttributeValues

Returns an array of attribute values for the accessibility object's attribute, starting at the specified index.

AXUIElementCopyElementAtPosition

Returns the accessibility object at the specified position in top-left relative screen coordinates.

AXUIElementCopyMultipleAttributeValues

Returns the values of multiple attributes in the accessibility object.

AXUIElementCopyParameterizedAttributeNames

Returns a list of all the parameterized attributes supported by the specified accessibility object.

AXUIElementCopyParameterizedAttributeValue

Returns the value of an accessibility object's parameterized attribute.

AXUIElementCreateApplication

Creates and returns the top-level accessibility object for the application with the specified process ID.

AXUIElementCreateSystemWide

Returns an accessibility object that provides access to system attributes.

AXUIElementGetAttributeValueCount

Returns the count of the array of an accessibility object's attribute value.

AXUIElementGetPid

Returns the process ID associated with the specified accessibility object.

AXUIElementGetTypeID

Returns the unique type identifier for the AXUIElementRef type.

AXUIElementIsAttributeSettable

Returns whether the specified accessibility object's attribute can be modified.

AXUIElementPerformAction

Requests that the specified accessibility object perform the specified action.

AXUIElementPostKeyboardEvent

Posts keys to the specified application.

Deprecated
AXUIElementSetAttributeValue

Sets the accessibility object's attribute to the specified value.

AXUIElementSetMessagingTimeout

Sets the timeout value used in the accessibility API.

Callbacks

See the Overview section above for header-level documentation.

Data Types

See the Overview section above for header-level documentation.

AXUIElementRef

A structure used to refer to an accessibility object.

Constants

See the Overview section above for header-level documentation.