AXUIElementSetAttributeValue(_:_:_:)
Sets the accessibility object's attribute to the specified value.
Declaration
func AXUIElementSetAttributeValue(_ element: AXUIElement, _ attribute: CFString, _ value: CFTypeRef) -> AXErrorParameters
- element:
The AXUIElementRef representing the accessibility object.
- attribute:
The attribute name.
- value:
The new value for the attribute.
Return Value
If unsuccessful, AXUIElementSetAttributeValue may return one of the following error codes, among others:
kAXErrorIllegalArgumentThe value is not recognized by the accessible application or one of the other arguments is an illegal value.
kAXErrorAttributeUnsupportedThe specified AXUIElementRef does not support the specified attribute.
kAXErrorInvalidUIElementThe AXUIElementRef is invalid.
kAXErrorCannotCompleteThe function cannot complete because messaging has failed in some way.
kAXErrorNotImplementedThe process does not fully support the accessibility API.
Discussion
You can send and receive many different CFTypeRefs using the accessibility API. These include all CFPropertyListRef types, AXUIElementRef, AXValueRef, AXTextMarkerRef, AXTextMarkerRangeRef, CFNullRef, CFAttributedStringRef, and CRURLRef.
See Also
Miscellaneous
AXIsProcessTrusted()AXIsProcessTrustedWithOptions(_:)AXUIElementCopyActionDescription(_:_:_:)AXUIElementCopyActionNames(_:_:)AXUIElementCopyAttributeNames(_:_:)AXUIElementCopyAttributeValue(_:_:_:)AXUIElementCopyAttributeValues(_:_:_:_:_:)AXUIElementCopyElementAtPosition(_:_:_:_:)AXUIElementCopyMultipleAttributeValues(_:_:_:_:)AXUIElementCopyParameterizedAttributeNames(_:_:)AXUIElementCopyParameterizedAttributeValue(_:_:_:_:)AXUIElementCreateApplication(_:)AXUIElementCreateSystemWide()AXUIElementGetAttributeValueCount(_:_:_:)AXUIElementGetPid(_:_:)AXUIElementGetTypeID()AXUIElementIsAttributeSettable(_:_:_:)AXUIElementPerformAction(_:_:)AXUIElementSetMessagingTimeout(_:_:)