docs » cp.apple.finalcutpro.MenuBar


Represents the Final Cut Pro menu bar, providing functions that allow different tasks to be accomplished.

API Overview

API Documentation

Constants

ROLE

Signature cp.apple.finalcutpro.MenuBar.ROLE -> string
Type Constant
Description The menubar role

Functions

new

Signature cp.apple.finalcutpro.MenuBar:new(App) -> MenuBar
Type Function
Description Constructs a new MenuBar for the specified App.
Parameters
  • app - The App instance the MenuBar belongs to.
Returns
  • a new MenuBar instance

selectMenu

Signature cp.apple.finalcutpro.MenuBar:selectMenu(path) -> boolean
Type Function
Description Selects a Final Cut Pro Menu Item based on the list of menu titles in English.
Parameters
  • path - The list of menu items you'd like to activate.
Returns
  • `true` if the press was successful.
Notes
  • Example usage:
  • `require("cp.apple.finalcutpro"):menuBar():selectMenu({"View", "Browser", "Toggle Filmstrip/List View"})`

Methods

addMenuFinder

Signature cp.apple.finalcutpro.MenuBar:addMenuFinder(finder) -> nothing
Type Method
Description Registers an AXMenuItem finder function. The finder's job is to take an individual 'find' step and return either the matching child, or nil if it can't be found. It is used by the addMenuFinder function. The finder should have the following signature:
Parameters
  • `finder` - The finder function
Returns
  • The `AXMenuItem` found, or `nil`.

app

Signature cp.apple.finalcutpro.MenuBar:app() -> App
Type Method
Description Returns the app instance representing Final Cut Pro.
Parameters
  • None
Returns
  • App

checkMenu

Signature cp.apple.finalcutpro.MenuBar:checkMenu(path, wait) -> boolean
Type Method
Description Checks a menu item.
Parameters
  • path - At table containing the path to the menu bar item.
  • wait - How long to wait before checking.
Returns
  • `true` if successful, otherwise `false`.

findMenuItemsUI

Signature cp.apple.finalcutpro.MenuBar:findMenuItemsUI(path) -> axuielementObject
Type Method
Description Returns the set of menu items in the provided path. If the path contains a menu, the
Parameters
  • path - A table containing the path to the menu.
Returns
  • An `axuielementObject` for the menu items.

findMenuUI

Signature cp.apple.finalcutpro.MenuBar:findMenuUI(path) -> Menu UI
Type Method
Description Finds a specific Menu UI element for the provided path.
Parameters
  • `path` - The path list to search for.
  • `language` - The language code the path is in. E.g. "en" or "fr". Defaults to the
Returns
  • The Menu UI, or `nil` if it could not be found.

getMainMenu

Signature cp.apple.finalcutpro.MenuBar:getMainMenu() -> table
Type Method
Description Returns a table of all the possible Menu Bar values for each language.
Parameters
  • None
Returns
  • A table of Menu Bar Values

isChecked

Signature cp.apple.finalcutpro.MenuBar:isChecked(path) -> boolean
Type Method
Description Is a menubar item checked?
Parameters
  • path - At table containing the path to the menu bar item.
Returns
  • `true` if checked otherwise `false`.

isEnabled

Signature cp.apple.finalcutpro.MenuBar:isEnabled(path) -> boolean
Type Method
Description Is a menubar item enabled?
Parameters
  • path - At table containing the path to the menu bar item.
Returns
  • `true` if enabled otherwise `false`.

isShowing

Signature cp.apple.finalcutpro.MenuBar:isShowing() -> boolean
Type Method
Description Tells you if the Final Cut Pro Menu Bar is visible.
Parameters
  • None
Returns
  • `true` if showing, otherwise `false`

UI

Signature cp.apple.finalcutpro.MenuBar:UI() -> axuielementObject
Type Method
Description Returns the Final Cut Pro Menu Bar Accessibility Object
Parameters
  • None
Returns
  • An `axuielementObject` on `nil`

uncheckMenu

Signature cp.apple.finalcutpro.MenuBar:uncheckMenu(path, wait) -> boolean
Type Method
Description Uncheck's a menu item.
Parameters
  • path - At table containing the path to the menu bar item.
  • wait - How long to wait before unchecking.
Returns
  • `true` if successful, otherwise `false`.

visitMenuItems

Signature cp.apple.finalcutpro.MenuBar:visitMenuItems(visitFn[, startPath]) -> nil
Type Method
Description Walks the menu tree, calling the visitFn on all the 'item' values - that is,
Parameters
  • `visitFn` - The function called for each menu item.
  • `startPath` - The path to the menu item to start at.
Returns
  • Nothing

results matching ""

    No results matching ""