finalcutpro
Represents the Final Cut Pro application, providing functions that allow different tasks to be accomplished.
Generally, you will
require
the cp.apple.finalcutpro
module to import it, like so:local fcp = require "cp.apple.finalcutpro"
Then, there are the
UpperCase
files, which represent the application itself:MenuBar
- The main menu bar.prefs/PreferencesWindow
- The preferences window.- etc...
The
fcp
variable is the root application. It has functions which allow you to perform tasks or access parts of the UI. For example, to open the Preferences
window, you can do this:fcp.preferencesWindow:show()
In general, as long as Final Cut Pro is running, actions can be performed directly, and the API will perform the required operations to achieve it. For example, to toggle the 'Create Optimized Media' checkbox in the 'Import' section of the 'Preferences' window, you can simply do this:
fcp.preferencesWindow.importPanel:toggleCreateOptimizedMedia()
The API will automatically open the
Preferences
window, navigate to the 'Import' panel and toggle the checkbox.The
UpperCase
classes also have a variety of UI
methods. These will return the axuielement
for the relevant GUI element, if it is accessible. If not, it will return nil
. These allow direct interaction with the GUI if necessary. It's most useful when adding new functions to UpperCase
files for a particular element.This can also be used to 'wait' for an element to be visible before performing a task. For example, if you need to wait for the
Preferences
window to finish loading before doing something else, you can do this with the just library:local just = require "cp.just"
local prefsWindow = fcp.preferencesWindow
local prefsUI = just.doUntil(function() return prefsWindow:UI() end)
if prefsUI then
-- it's open!
else
-- it's closed!
end
By using the
just
library, we can do a loop waiting until the function returns a result that will give up after a certain time period (10 seconds by default).Of course, we have a specific support function for that already, so you could do this instead:
if fcp.preferencesWindow:isShowing() then
-- it's open!
else
-- it's closed!
end
Note: All values/methods/props from delegates can be accessed directly from the
cp.apple.finalcutpro
instance. For example:fcp.app:UI() == fcp:UI() -- the same `cp.prop` result.
- Constants - Useful values which cannot be changed
- Variables - Configurable values
- Functions - API calls offered directly by the extension
- Constructors - API calls which return an object, typically one that offers API methods
- 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
Signature | cp.apple.finalcutpro.ALLOWED_IMPORT_AUDIO_EXTENSIONS -> table |
Type | Constant |
Description | Table of audio file extensions Final Cut Pro can import. |
Signature | cp.apple.finalcutpro.ALLOWED_IMPORT_EXTENSIONS -> table |
Type | Constant |
Description | Table of all file extensions Final Cut Pro can import. |
Signature | cp.apple.finalcutpro.ALLOWED_IMPORT_IMAGE_EXTENSIONS -> table |
Type | Constant |
Description | Table of image file extensions Final Cut Pro can import. |
Signature | cp.apple.finalcutpro.ALLOWED_IMPORT_VIDEO_EXTENSIONS -> table |
Type | Constant |
Description | Table of video file extensions Final Cut Pro can import. |
Signature | cp.apple.finalcutpro.EARLIEST_SUPPORTED_VERSION -> string |
Type | Constant |
Description | The earliest version of Final Cut Pro supported by this module. |
Signature | cp.apple.finalcutpro.EVENT_DESCRIPTION_PATH -> string |
Type | Constant |
Description | The Event Description Path. |
Signature | cp.apple.finalcutpro.FLEXO_LANGUAGES -> table |
Type | Constant |
Description | Table of Final Cut Pro's supported Languages for the Flexo Framework |
Signature | cp.apple.finalcutpro.PASTEBOARD_UTI -> string |
Type | Constant |
Description | Final Cut Pro's Pasteboard UTI |
Signature | cp.apple.finalcutpro.preferences <cp.app.prefs> |
Type | Constant |
Description | The cp.app.prefs for Final Cut Pro. |
Signature | cp.apple.finalcutpro.WORKSPACES_PATH -> string |
Type | Constant |
Description | The path to the custom workspaces folder. |
Signature | cp.apple.finalcutpro.activeCommandSet <cp.prop: table; live> |
Type | Variable |
Description | Contins the 'Active Command Set' as a table . The result is cached, but |
Signature | cp.apple.finalcutpro:customWorkspaces <cp.prop: table; live> |
Type | Variable |
Description | A table containing the display names of all the user created custom workspaces. |
Signature | cp.apple.finalcutpro:openAndSavePanelDefaultPath <cp.prop: string> |
Type | Variable |
Description | A string containing the default open/save panel path. |
Signature | cp.apple.finalcutpro.selectedWorkspace <cp.prop: string; live> |
Type | Variable |
Description | The currently selected workspace name. The result is cached, but updated |
Signature | cp.apple.finalcutpro.commandSet(path) -> string |
Type | Function |
Description | Gets the Command Set at the specified path as a table. |
Parameters |
|
Returns |
|
Signature | cp.apple.finalcutpro.main.CommandEditor.matches(element) -> boolean |
Type | Function |
Description | Checks to see if an element matches what we think it should be. |
Parameters |
|
Returns |
|
Signature | cp.apple.finalcutpro.viewer.TranscodeMedia.matches(element) -> boolean |
Type | Function |
Description | Checks if the element is an TranscodeMedia instance. |
Parameters |
|
Returns |
|
Signature | cp.apple.finalcutpro.userCommandSetPath() -> string or nil |
Type | Function |
Description | Gets the path where User Command Set files are stored. |
Parameters |
|
Returns |
|
Signature | cp.apple.finalcutpro.workflowExtensions() -> table |
Type | Function |
Description | Gets the names of all the installed Workflow Extensions. |
Parameters |
|
Returns |
|
Signature | cp.apple.finalcutpro.main.Color(app) -> Color |
Type | Constructor |
Description | Creates a new Color instance. |
Parameters |
|
Returns |
|
Signature | cp.apple.finalcutpro.viewer.TranscodeMedia(viewer) |
Type | Constructor |
Description | Creates a new TranscodeMedia instance. |
Parameters |
|
Returns |
|
Signature | cp.apple.finalcutpro.activeCommandSetPath <cp.prop: string> |
Type | Field |
Description | Gets the 'Active Command Set' value from the Final Cut Pro preferences |
Signature | cp.apple.finalcutpro.alert <cp.ui.Alert> |
Type | Field |
Description | Provides basic access to any 'alert' dialog windows in the app. |
Signature | cp.apple.finalcutpro.inspector.color.VideoInspector.audioEnhancements <cp.prop: PropertyRow> |
Type | Field |
Description | Audio Enhancements |
Signature | cp.apple.finalcutpro.timeline.audioLanes <cp.prop: boolean> |
Type | Field |
Description | Indicates if audio lanes are currently showing. May be set to ensure it is showing or hidden. |
Signature | cp.apple.finalcutpro.backgroundTasksDialog <cp.apple.finalcutpro.main.BackgroundTasksDialog> |
Type | Field |
Description |