hs.axuielement.observer.notifications[]
hs.axuielement.observer.new(pid) -> observerObject
pid
- the process ID of the application.hs.application
object for an application, you can get its process ID with hs.application:pid()
hs.axuielement
from the application you wish to observe (it doesn't have to be the application axuielement object, just one belonging to the application), you can get the process ID with hs.axuielement:pid()
.hs.axuielement.observer:addWatcher(element, notification) -> observerObject
element
- the hs.axuielement
representing an accessibility element of the application the observer was created for.notification
- a string specifying the notification.hs.axuielement.observer.notifications
, but the list is not exhaustive nor is an application or element required to provide them.hs.axuielement.observer:callback([fn]) -> observerObject | fn | nil
| | -----------------------------------------------------|---------------------------------------------------------------------------------------------------------| | Type | Method | | Description | Get or set the callback for the observer. | | Parameters |fn
- a function, specifying the callback to the observer will invoke when the assigned elements generate notifications. If nil
is supplied, the existing callback function will be removedhs.axuielement
object for the accessibility element which generated the notificationhs.axuielement.observer:isRunning() -> boolean
hs.axuielement.observer:removeWatcher(element, notification) -> observerObject
element
- the hs.axuielement
representing an accessibility element of the application the observer was created for.notification
- a string specifying the notification.hs.axuielement.observer:start() -> observerObject
hs.axuielement.observer:stop() -> observerObject
hs.axuielement.observer:watching([element]) -> table
element
- an optional hs.axuielement
to return a list of registered notifications for.hs.axuielement
that is being observed and the corresponding value will be a table containing a list of strings specifying the specific notifications that the observer is watching for from from that element.