Internationalisation
Bundled Plugins API
dev
A set of handy developer tools for CommandPost.

API Overview

API Documentation

Functions

Signature
cp.dev.elementAtMouse() -> axuielementObject
Type
Function
Description
Gets the AX element under the current mouse position.
Parameters
  • None
Returns
  • None
Signature
cp.dev.findUnusedLanguageStrings() -> string
Type
Function
Description
Searches for any unused language strings in English.json.
Parameters
  • None
Returns
  • A string with the results of the search.

highlight

Signature
cp.dev.highlight(element) -> axuielementObject
Type
Function
Description
Highlights an AX element on the screen.
Parameters
  • element - The AX element to highlight.
Returns
  • The element.
Signature
cp.dev.highlightFrame(frame) -> none
Type
Function
Description
Highlights aa frame on the screen.
Parameters
  • frame - A hs.geometry frame object.
Returns
  • None
Signature
cp.dev.highlightPoint(point) -> none
Type
Function
Description
Highlights a point on the screen.
Parameters
  • point - A hs.geometry point object.
Returns
  • None

hotkey

Signature
cp.dev.hotkey(fn) -> none
Type
Function
Description
Assigns a function to the CONTROL+OPTION+COMMAND+SHIFT+Q keyboard combination.
Parameters
  • fn - A function to execute when the hotkey is triggered.
Returns
  • None

inspect

Signature
cp.dev.inspect(item, options) -> string
Type
Function
Description
Inspect an item.
Parameters
  • item - The object to inspect.
  • options - Any additional options to pass along to cp.dev.inspectElement.
Returns
  • A results as a string.
Signature
cp.dev.inspectAtMouse(options) -> none
Type
Function
Description
Inspects an AX element under the current mouse position.
Parameters
  • options - Any additional options to pass along to cp.dev.inspectElement.
Returns
  • None
Signature
cp.dev.inspectElement(element[, options]) -> none
Type
Function
Description
Inspect an AX element. Writes results to Debug Console.
Parameters
  • element - The element to inspect.
  • options - A table containing any optional values.
Returns
  • None.
Notes
  • The options table accepts the following parameters:
  • depth - A number representing the maximum depth to recurse into variable.
Signature
cp.dev.inspectElementAtMousePath() -> none
Type
Function
Description
Inspects an AX element at the mouse path.
Parameters
  • None
Returns
  • None

test

Signature
cp.dev.test(id) -> cp.test
Type
Function
Description
This function will return a cp.test with either the
Parameters
  • id - the id to test.
Returns
  • A [cp.test] to execute.

which

Signature
cp.dev.which(cmd) -> none
Type
Function
Description
The which utility takes a list of command names and searches the path for
Parameters
  • cmd - The parameters to pass along to the which executable.
Returns
  • The path or nil and the error message if an error occurs.
Last modified 1mo ago
Export as PDF
Copy link