Internationalisation
Bundled Plugins API
Menu
UI for AXMenus.

API Overview

  • Functions - API calls offered directly by the extension
  • matches
  • Constructors - API calls which return an object, typically one that offers API methods
  • Menu
  • Methods - API calls which can only be made on an object returned by a constructor
  • cancel

API Documentation

Functions

matches

Signature
cp.ui.Menu.matches(element) -> boolean
Type
Function
Description
Checks to see if an element matches what we think it should be.
Parameters
  • element - An axuielementObject to check.
Returns
  • true if matches otherwise false

Constructors

Signature
cp.ui.Menu(parent, uiFinder) -> Menu
Type
Constructor
Description
Creates a new Menu instance.
Parameters
  • parent - The parent object.
  • uiFinder - A function which will return the hs._asm.axuielement when available.
Returns
  • A new Menu object.

Methods

cancel

Signature
cp.ui.Menu:cancel() -> self
Type
Method
Description
Closes a menu.
Parameters
  • None
Returns
  • Self
Signature
cp.ui.Menu:doSelectItem(index) -> cp.rx.go.Statement
Type
Method
Description
A Statement that will select an item on the MenuButton by index.
Parameters
  • index - The index number of the item to match.
Returns
  • the Statement.
Signature
cp.ui.Menu:doSelectValue(pattern[, altPattern]) -> cp.rx.go.Statement
Type
Method
Description
A Statement that will select an item on the Menu by value.
Parameters
  • pattern - The pattern to match.
  • [altPattern] - An optional alternate pattern to match if the first pattern fails.
Returns
  • the Statement.
Last modified 1mo ago