This submodule allows you to create observers for accessibility elements and be notified when they trigger notifications. Not all notifications are supported by all elements and not all elements support notifications, so some trial and error will be necessary, but for compliant applications, this can allow your code to be notified when an application's user interface changes in some way.
Signature | hs.axuielement.observer.notifications[] |
---|---|
Type | Constant |
Description | A table of common accessibility object notification names, provided for reference. |
Notes |
|
Source | extensions/axuielement/observer.m line 402 |
Signature | hs.axuielement.observer.new(pid) -> observerObject |
---|---|
Type | Constructor |
Description | Creates a new observer object for the application with the specified process ID. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/axuielement/observer.m line 117 |
Signature | hs.axuielement.observer:addWatcher(element, notification) -> observerObject |
---|---|
Type | Method |
Description | Registers the specified notification for the specified accessibility element with the observer. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/axuielement/observer.m line 263 |
Signature | hs.axuielement.observer:callback([fn]) -> observerObject | fn | nil |
---|---|
Type | Method |
Description | Get or set the callback for the observer. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/axuielement/observer.m line 221 |
Signature | hs.axuielement.observer:isRunning() -> boolean |
---|---|
Type | Method |
Description | Returns true or false indicating whether the observer is currently watching for notifications and generating callbacks. |
Parameters |
|
Returns |
|
Source | extensions/axuielement/observer.m line 202 |
Signature | hs.axuielement.observer:removeWatcher(element, notification) -> observerObject |
---|---|
Type | Method |
Description | Unregisters the specified notification for the specified accessibility element from the observer. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/axuielement/observer.m line 308 |
Signature | hs.axuielement.observer:start() -> observerObject |
---|---|
Type | Method |
Description | Start observing the application and trigger callbacks for the elements and notifications assigned. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/axuielement/observer.m line 148 |
Signature | hs.axuielement.observer:stop() -> observerObject |
---|---|
Type | Method |
Description | Stop observing the application; no further callbacks will be generated. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/axuielement/observer.m line 175 |
Signature | hs.axuielement.observer:watching([element]) -> table |
---|---|
Type | Method |
Description | Returns a table of the notifications currently registered with the observer. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/axuielement/observer.m line 348 |