Supports long-lived 'AX' notifiers. Configure the application to watch, the function that provides the axuielement
and then register for the type of notification to watch, along with a function that will get triggered.
For example:
local notifier = require("cp.ui.notifier")local function finder() ... end -- returns the axuielementlocal o = notifier.new("com.apple.FinalCut", finder)o:watchFor("AXValueChanged", function(notifier, element, notification, details) ... end)o:start()
Functions - API calls offered directly by the extension
​notifiersForBundleID​
Constructors - API calls which return an object, typically one that offers API methods
​new​
Signature |
|
Type | Function |
Description | Returns the list of |
Parameters | bundleID - The application Bundle ID being observed. E.g. "com.apple.FinalCut". |
Returns | A table of |
Signature |
|
Type | Constructor |
Description | Creates a new |
Parameters | bundleID - The application Bundle ID being observed. E.g. "com.apple.FinalCut". * elementFinderFn - The function that will return the |
Returns | A new |
Signature |
|
Type | Method |
Description | Returns the current |
Parameters | None |
Returns | The running |
Signature |
|
Type | Method |
Description | Returns the application 'bundle ID' that this notifier is tracking. |
Parameters | None |
Returns | The application 'bundle ID' string (e.g. "com.apple.FinalCut") |
Signature |
|
Type | Method |
Description | Returns the current |
Parameters | None |
Returns | The |
Signature |
|
Type | Method |
Description | Enables/disables and reports current debugging status. |
Parameters | enabled - If |
Returns |
|
Signature |
|
Type | Method |
Description | Returns the PID for the application being observed, or |
Parameters | None |
Returns | The PID, or |
Signature |
|
Type | Method |
Description | Resets the notifier |
Signature |
|
Type | Method |
Description | Stops notifying watchers when events happen. |
Parameters | None |
Returns | The |
Signature |
|
Type | Method |
Description | Updates any watchers to use the current |
Parameters | force - If |
Returns | The |
Signature |
|
Type | Method |
Description | Registers the callback as a watcher for all standard notifications for the current |
Parameters | callbackFn - the function to call when the notification happens. |
Returns | The |
Notes | This should generally just be used for debugging purposes. It's best to use |
Signature |
|
Type | Method |
Description | Registers a function to get called whenever the specified notification type is triggered |
Parameters | notifications - The |
Returns | The |
Notes | The callback function should expect 3 arguments and return none. The arguments passed to the callback will be as follows: * the |