axutils

Utility functions to support hs._asm.axuielement.

API Overview

API Documentation

Functions

cache

Signature

cp.ui.axutils.cache(source, key, finderFn, [verifyFn]) -> axuielement

Type

Function

Description

Checks if the cached value at the source[key] is a valid axuielement. If not

Parameters

Returns

Signature

cp.ui.axutils.childAtIndex(element, index, compareFn[, matcherFn]) -> axuielement

Type

Function

Description

Searches for the child element which is at number index when sorted using the compareFn.

Parameters

Returns

Signature

cp.ui.axutils.childFromBottom(element, index) -> axuielement

Type

Function

Description

Searches for the child element which is at number index when sorted bottom-to-top.

Parameters

Returns

Signature

cp.ui.axutils.childFromLeft(element, index[, matcherFn]) -> axuielement

Type

Function

Description

Searches for the child element which is at number index when sorted left-to-right.

Parameters

Returns

Signature

cp.ui.axutils.childFromRight(element, index[, matcherFn]) -> axuielement

Type

Function

Description

Searches for the child element which is at number index when sorted right-to-left.

Parameters

Returns

Signature

cp.ui.axutils.childFromTop(element, index[, matcherFn]) -> axuielement

Type

Function

Description

Searches for the child element which is at number index when sorted top-to-bottom.

Parameters

Returns

Signature

cp.ui.axutils.childMatching(element, matcherFn[, index]) -> axuielement

Type

Function

Description

This searches for the first child of the specified element for which the provided function returns true.

Parameters

Returns

children

Signature

`cp.ui.axutils.children(element) -> table

nil` </span>

Type

Function

Description

Finds the children for the element. If it is an hs._asm.axuielement, it will

Parameters

Returns

Signature

cp.ui.axutils.childrenMatching(element, matcherFn) -> { axuielement }

Type

Function

Description

This searches for all children of the specified element for which the provided

Parameters

Returns

Signature

cp.ui.axutils.childrenWith(element, name, value) -> axuielement

Type

Function

Description

This searches for all children of the specified element which has an attribute with the matching name and value.

Parameters

Returns

Signature

cp.ui.axutils.childrenWithRole(element, value) -> axuielement

Type

Function

Description

This searches for all children of the specified element which has an AXRole attribute with the matching value.

Parameters

Returns

childWith

Signature

cp.ui.axutils.childWith(element, name, value) -> axuielement

Type

Function

Description

This searches for the first child of the specified element which has an attribute with the matching name and value.

Parameters

Returns

Signature

cp.ui.axutils.childWithDescription(element, value) -> axuielement

Type

Function

Description

This searches for the first child of the specified element which has AXDescription with the specified value.

Parameters

Returns

Signature

cp.ui.axutils.childWithID(element, value) -> axuielement

Type

Function

Description

This searches for the first child of the specified element which has AXIdentifier with the specified value.

Parameters

Returns

Signature

cp.ui.axutils.childWithRole(element, value) -> axuielement

Type

Function

Description

This searches for the first child of the specified element which has AXRole with the specified value.

Parameters

Returns

Signature

cp.ui.axutils.compareBottomToTop(a, b) -> boolean

Type

Function

Description

Returns true if element a is below element b. May be used with table.sort.

Returns

Signature

cp.ui.axutils.compareLeftToRight(a, b) -> boolean

Type

Function

Description

Returns true if element a is left of element b. May be used with table.sort.

Returns

Signature

cp.ui.axutils.compareRightToLeft(a, b) -> boolean

Type

Function

Description

Returns true if element a is right of element b. May be used with table.sort.

Returns

Signature

cp.ui.axutils.compareTopToBottom(a, b) -> boolean

Type

Function

Description

Returns true if element a is above element b. May be used with table.sort.

Returns

Signature

cp.ui.axutils.hasAttributeValue(element, name, value) -> boolean

Type

Function

Description

Checks to see if an element has a specific value.

Parameters

Returns

isValid

Signature

cp.ui.axutils.isValid(element) -> boolean

Type

Function

Description

Checks if the axuilelement is still valid - that is, still active in the UI.

Parameters

Returns

snapshot

Signature

cp.ui.axutils.snapshot(element, [filename]) -> hs.image

Type

Function

Description

Takes a snapshot of the specified axuielement and returns it.

Parameters

Returns