# plugins.finalcutpro.pasteboard.manager

Pasteboard Manager.


# API Overview

Constants - Useful values which cannot be changed

  • NUMBER_OF_PASTEBOARD_BUFFERS
  • RESTART_DELAY

Variables - Configurable values

  • excludedClassnames
  • WATCHER_FREQUENCY

Functions - API calls offered directly by the extension

  • copyWithCustomClipName
  • doDecodeBuffer
  • doRestoreFromBuffer
  • doSaveToBuffer
  • doWaitForData
  • doWaitForFreshData
  • getClassname
  • isTimelineClip
  • ninjaPasteboardCopy
  • overrideNextClipName
  • processArray
  • processContent
  • processObject
  • readFCPXData
  • startWatching
  • stopWatching
  • supportsContainedItems
  • unarchiveFCPXData
  • unwatch
  • watch
  • writeFCPXData

Fields - Variables which can only be accessed from an object returned by a constructor

  • watching

# API Documentation

# Constants

# NUMBER_OF_PASTEBOARD_BUFFERS

Signature plugins.finalcutpro.pasteboard.manager.NUMBER_OF_PASTEBOARD_BUFFERS -> number
Type Constant
Description Number of Pasteboard Buffers.
Notes None
Source src/plugins/finalcutpro/pasteboard/manager.lua line 67

# RESTART_DELAY

Signature plugins.finalcutpro.pasteboard.manager.RESTART_DELAY -> number
Type Constant
Description How long to wait until we restart any Pasteboard Watchers in milliseconds.
Notes None
Source src/plugins/finalcutpro/pasteboard/manager.lua line 72

# Variables

# excludedClassnames

Signature plugins.finalcutpro.pasteboard.manager.excludedClassnames -> table
Type Variable
Description Table of data we don't want to count when copying.
Notes None
Source src/plugins/finalcutpro/pasteboard/manager.lua line 77

# WATCHER_FREQUENCY

Signature plugins.finalcutpro.pasteboard.manager.WATCHER_FREQUENCY -> number
Type Variable
Description The Pasteboard Watcher Update frequency.
Notes None
Source src/plugins/finalcutpro/pasteboard/manager.lua line 62

# Functions

# copyWithCustomClipName

Signature plugins.finalcutpro.pasteboard.manager.copyWithCustomClipName() -> none
Type Function
Description Copy with custom label.
Parameters
  • None
Returns
  • None
Notes None
Examples None
Source src/plugins/finalcutpro/pasteboard/manager.lua line 271

# doDecodeBuffer

Signature plugins.finalcutpro.pasteboard.manager.doDecodeBuffer(id) -> cp.rx.go.Statement
Type Function
Description A Statement which decodes the buffer with the specified ID.
Parameters
  • id - The ID to decode
Returns
  • A Statement that sends the decoded buffer, or throws an error if not available.
Notes None
Examples None
Source src/plugins/finalcutpro/pasteboard/manager.lua line 601

# doRestoreFromBuffer

Signature plugins.finalcutpro.pasteboard.manager.doRestoreFromBuffer(id) -> cp.rx.go.Statement
Type Function
Description A Statement which restore a Pasteboard item from the buffer.
Parameters
  • id - The ID of the buffer item.
Returns
Notes None
Examples None
Source src/plugins/finalcutpro/pasteboard/manager.lua line 622

# doSaveToBuffer

Signature plugins.finalcutpro.pasteboard.manager.doSaveToBuffer(id) -> cp.rx.go.Statement
Type Function
Description A Statement which saves a Pasteboard item to the buffer.
Parameters
  • id - The ID of the buffer item.
Returns
Notes None
Examples None
Source src/plugins/finalcutpro/pasteboard/manager.lua line 551

# doWaitForData

Signature plugins.finalcutpro.pasteboard.manager.doWaitForData(newData) -> cp.rx.go.Statement
Type Function
Description A Statement which waits for up to 10 seconds for new data to appear on the clipboard. If none is found, an error is sent.
Parameters
  • newData - The new Pasteboard data.
Returns
Notes None
Examples None
Source src/plugins/finalcutpro/pasteboard/manager.lua line 531

# doWaitForFreshData

Signature plugins.finalcutpro.pasteboard.manager.doWaitForFreshData(oldData) -> cp.rx.go.Statement
Type Function
Description A Statement which waits for up to 10 seconds for new data to copy to the clipboard. If none is found, an error is sent.
Parameters
  • oldData - The original Pasteboard data.
Returns
Notes None
Examples None
Source src/plugins/finalcutpro/pasteboard/manager.lua line 511

# getClassname

Signature plugins.finalcutpro.pasteboard.manager.getClassname(data) -> string
Type Function
Description Gets a class anem from data
Parameters
  • data - The data object to process
Returns
  • Class name as string
Notes None
Examples None
Source src/plugins/finalcutpro/pasteboard/manager.lua line 162

# isTimelineClip

Signature plugins.finalcutpro.pasteboard.manager.isTimelineClip(data) -> boolean
Type Function
Description Is the data a timeline clip.
Parameters
  • data - The pasteboard data you want to check.
Returns
  • true if a timeline clip otherwise false.
Notes None
Examples None
Source src/plugins/finalcutpro/pasteboard/manager.lua line 87

# ninjaPasteboardCopy

Signature plugins.finalcutpro.pasteboard.manager.ninjaPasteboardCopy() -> boolean, data
Type Function
Description Ninja Pasteboard Copy. Copies something to the pasteboard, then restores the original pasteboard item.
Parameters
  • None
Returns
  • true if successful otherwise false
  • The pasteboard data
Notes None
Examples None
Source src/plugins/finalcutpro/pasteboard/manager.lua line 673

# overrideNextClipName

Signature plugins.finalcutpro.pasteboard.manager.overrideNextClipName(overrideName) -> none
Type Function
Description Overrides the name for the next clip which is copied from FCPX to the specified value. Once the override has been used, the standard clip name via mod.findClipName(...) will be used for subsequent copy operations.
Parameters
  • overrideName - The override name.
Returns
  • None
Notes None
Examples None
Source src/plugins/finalcutpro/pasteboard/manager.lua line 258

# processArray

Signature plugins.finalcutpro.pasteboard.manager.processArray(data) -> string, number
Type Function
Description Processes an 'array' table.
Parameters
  • data - The data object to process
Returns
  • The primary clip name as a string.
  • The number of clips as number.
Notes None
Examples None
Source src/plugins/finalcutpro/pasteboard/manager.lua line 125

# processContent

Signature plugins.finalcutpro.pasteboard.manager.processContent(fcpxData, default) -> string, number
Type Function
Description Searches the Pasteboard binary plist data for the first clip name, and returns it.
Parameters
  • fcpxData - The data object to process
  • default - The default value
Returns
  • Returns the 'default' value if the pasteboard contains a media clip but we could not interpret it, otherwise nil if the data did not contain Final Cut Pro Clip data.
Notes
  • Example usage: local name = mod.findClipName(myFcpxData, "Unknown")
Examples None
Source src/plugins/finalcutpro/pasteboard/manager.lua line 226

# processObject

Signature plugins.finalcutpro.pasteboard.manager.processObject(data) -> string, number
Type Function
Description Processes the provided data object, which should have a '$class' property.
Parameters
  • data - The pasteboard data you want to check.
Returns
  • The primary clip name as a string.
  • The number of clips as number.
Notes None
Examples None
Source src/plugins/finalcutpro/pasteboard/manager.lua line 100

# readFCPXData

Signature plugins.finalcutpro.pasteboard.manager.readFCPXData() -> data | nil
Type Function
Description Reads Final Cut Pro Data from the Pasteboard as a binary Property List, if present.
Parameters
  • None
Returns
  • The pasteboard data or nil.
Notes None
Examples None
Source src/plugins/finalcutpro/pasteboard/manager.lua line 290

# startWatching

Signature plugins.finalcutpro.pasteboard.manager.startWatching() -> none
Type Function
Description Start Watching the Pasteboard.
Parameters
  • None
Returns
  • None
Notes None
Examples None
Source src/plugins/finalcutpro/pasteboard/manager.lua line 411

# stopWatching

Signature plugins.finalcutpro.pasteboard.manager.stopWatching() -> none
Type Function
Description Stop Watching the Pasteboard.
Parameters
  • None
Returns
  • None
Notes None
Examples None
Source src/plugins/finalcutpro/pasteboard/manager.lua line 487

# supportsContainedItems

Signature plugins.finalcutpro.pasteboard.manager.supportsContainedItems(data) -> boolean
Type Function
Description Gets whether or not the data supports contained items.
Parameters
  • data - The data object to process
Returns
  • true if supported otherwise false.
Notes None
Examples None
Source src/plugins/finalcutpro/pasteboard/manager.lua line 148

# unarchiveFCPXData

Signature plugins.finalcutpro.pasteboard.manager.unarchiveFCPXData(fcpxData) -> data | nil
Type Function
Description Unarchive Final Cut Pro data.
Parameters
  • fcpxData - The data object to process
Returns
  • The unarchived Final Cut Pro Pasteboard data or nil.
Notes None
Examples None
Source src/plugins/finalcutpro/pasteboard/manager.lua line 311

# unwatch

Signature plugins.finalcutpro.pasteboard.manager.unwatch(id) -> boolean
Type Function
Description Stop a watcher.
Parameters
  • id - The ID of the watcher you want to stop.
Returns
  • true if successful otherwise false.
Notes None
Examples None
Source src/plugins/finalcutpro/pasteboard/manager.lua line 388

# watch

Signature plugins.finalcutpro.pasteboard.manager.watch(events) -> table
Type Function
Description Watch events.
Parameters
  • events - Table of events
Returns
  • Table of watchers.
Notes None
Examples None
Source src/plugins/finalcutpro/pasteboard/manager.lua line 361

# writeFCPXData

Signature plugins.finalcutpro.pasteboard.manager.writeFCPXData(fcpxData, quiet) -> boolean
Type Function
Description Write Final Cut Pro data to Pasteboard.
Parameters
  • fcpxData - The data to write
  • quiet - Whether or not we should stop/start the watcher.
Returns
  • true if the operation succeeded, otherwise false (which most likely means ownership of the pasteboard has changed).
Notes None
Examples None
Source src/plugins/finalcutpro/pasteboard/manager.lua line 341

# Fields

# watching

Signature plugins.finalcutpro.pasteboard.manager.watching <cp.prop: boolean>
Type Field
Description Gets whether or not we're watching the pasteboard as a boolean.
Notes None
Source src/plugins/finalcutpro/pasteboard/manager.lua line 504