Internationalisation
Bundled Plugins API
Toolbar
Toolbar Module.

API Overview

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

API Documentation

Functions

matches

Signature
cp.ui.Toolbar.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

Toolbar

Signature
cp.ui.Toolbar(parent, uiFinder) -> cp.ui.Toolbar
Type
Constructor
Description
Creates a new Toolbar instance, given the specified parent and uiFinder
Parameters
  • parent - The parent object.
  • uiFinder - The cp.prop or function that finds the hs._asm.axuielement that represents the Toolbar.
Returns
  • The new Toolbar instance.

Fields

Signature
cp.ui.Toolbar.overflowButton <cp.ui.Button>
Type
Field
Description
The "overflow" button which appears if there are more toolbar items
Signature
cp.ui.Toolbar.selectedTitle <cp.prop: string; read-only>
Type
Field
Description
The title of the first selected item, if available.

Methods

doSelect

Signature
cp.ui.Toolbar:doSelect(title) -> Statement
Type
Method
Description
Returns a Statement that will select the toolbar item with the specified title.
Parameters
  • title - The title to select, if present.
Returns
  • A Statement that when executed returns true if the item was found and selected, otherwise false.
Last modified 1mo ago