Contents

AXUIElementSetMessagingTimeout(_:_:)

Sets the timeout value used in the accessibility API.

Declaration

func AXUIElementSetMessagingTimeout(_ element: AXUIElement, _ timeoutInSeconds: Float) -> AXError

Parameters

  • element:

    The AXUIElementRef representing an accessibility object.

  • timeoutInSeconds:

    The number of seconds for the new timeout value.

Return Value

If unsuccessful, AXUIElementSetMessagingTimeout may return one of the following error codes, among others:

kAXErrorIllegalArgument

One or more of the arguments is an illegal value (timeout values must be positive).

kAXErrorInvalidUIElement

The AXUIElementRef is invalid.

Discussion

Pass the system-wide accessibility object (see AXUIElementCreateSystemWide()) if you want to set the timeout globally for this process. Setting the timeout on another accessibility object sets it only for that object, not for other accessibility objects that are equal to it.

Setting timeoutInSeconds to 0 for the system-wide accessibility object resets the global timeout to its default value. Setting timeoutInSeconds to 0 for any other accessibility object makes that element use the current global timeout value.

See Also

Miscellaneous