Skip to content
This repository has been archived by the owner on Jun 9, 2023. It is now read-only.

Latest commit

 

History

History
63 lines (51 loc) · 4.52 KB

cp.ui.Menu.md

File metadata and controls

63 lines (51 loc) · 4.52 KB

docs » cp.ui.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
  • doSelectItem
  • doSelectValue

API Documentation

Functions

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

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.