Internationalisation
Bundled Plugins API
Button
The Button type extends Element and includes all its methods, fields and other properties.

API Overview

  • Functions - API calls offered directly by the extension
  • matches
  • Constructors - API calls which return an object, typically one that offers API methods
  • Button
  • Fields - Variables which can only be accessed from an object returned by a constructor
  • title
  • Methods - API calls which can only be made on an object returned by a constructor
  • doPress
  • press

API Documentation

Functions

matches

Signature
cp.ui.Button.matches(element) -> boolean
Type
Function
Description
Checks if the element is a Button, returning true if so.
Parameters
  • element - The hs._asm.axuielement to check.
Returns
  • true if the element is a Button, or false if not.

Constructors

Button

Signature
cp.ui.Button(parent, uiFinder) -> cp.ui.Button
Type
Constructor
Description
Creates a new Button instance.
Parameters
  • parent - The parent object. Should have a UI and isShowing field.
  • uiFinder - A function which will return the hs._asm.axuielement the button belongs to, or nil if not available.
Returns
The new Button instance.

Fields

title

Signature
cp.ui.Button.title <cp.prop: string; read-only>
Type
Field
Description
The button title, if available.

Methods

doPress

Signature
cp.ui.Button:doPress() -> cp.rx.go.Statement
Type
Method
Description
Returns a Statement that will press the button when executed, if available at the time.
Parameters
  • None
Returns
  • The Statement which will press the button when executed.

press

Signature
cp.ui.Button:press() -> self, boolean
Type
Method
Description
Performs a button press action, if the button is available.
Parameters
  • None
Returns
  • The Button instance.
  • true if the button was actually pressed successfully.
Last modified 1mo ago