Scripting API [Beta]
Last updated
Was this helpful?
Last updated
Was this helpful?
As of , Workflower has its own scripting API in beta to automate all kinds of processes in After Effects + Workflower.
Please be aware that the API is experimental at the moment and has to be used with caution! Some functions might not work as expected.
Also, the API is still very limited but this will change in the future as more functions will get added.
The API variable (a global variable) is called:
Workflower needs to have been started at least once in your current session for the API variable to be active.
You can easily check whether the API exists, like this (and if it doesn't exist, just open and close the ScriptUI Panel, so the variable gets established):
The Workflower functions listed below are exposed to the API. Just call them and use their arguments if you want to.
If a parameter is undefined, the default execution value is used.
Currently, it is recommended to only use API functions in your active comp. They theoretically work when processing other comps but unexpected behaviors can occur!
So to be safe when using all other functions, always check whether the comp you want to work on is active. Like this:
When calling a function through the API, Workflower will not create any undo groups to ensure that you can wrap everything in your own undo groups and don't get any undo mismatch errors.
At the moment, the Workflower API will not throw any custom errors. So always double-check with the user guide that the function is called properly. If you come across any unexpected errors, please contact customer support.
The currently installed version number of Workflower.
String of script version number; read-only
The current version number of the Workflower API.
String of API version number; read-only
Checks whether the Workflower script exists.
Boolean
Checks whether the Workflower ScriptUI Panel exists.
Boolean
Cleans layer names, i.e. removes all special characters added by Workflower as well as the indent.
layerNames: Array of layer name strings to be cleaned.
Array of layer name strings
Checks whether a given comp is a Workflower comp.
comp: Comp object to be checked.
Boolean
Checks whether a given layer is a group header.
layer: Layer object to be checked.
Boolean
Gets all group layers to a given group header.
groupHeader: Layer object of the group header.
Array of layer objects of the group layers
layer: Layer object to be checked.
tagID: Integer of tag ID (0 - 16).
Boolean
layer: Layer object to be checked.
tagName: String of tag name.
Boolean
This function only calls the regular Workflower functions as they are called by the user interface. The other dedicated API functions, on the other hand, let you define custom arguments as well.
doCreateUndoGroup: Optional. Boolean to define whether you want Workflower to create its regular undo groups. Default is false.
Nothing
wfAPI.kbarExecute() is only meant to execute a single command via KBar's Run Scriptlet feature. If you want to run multiple commands, you need to use wfAPI.execute() or any other function listed here, wrap the commands within a function and call the function with app.setTimeout(), so for example:
Nothing
Refreshes the comp layout.
comp: Optional. Comp object to be refreshed. Default is current comp.
Nothing
Refreshes the layout of multiple comps. Added in script version 2.04 / API version 0.2.
comps: Array of comp objects to be refreshed. Default is none.
Nothing
Creates a Workflower group.
groupLayers: Array of layer objects to be grouped.
groupName: Optional. String of the group name. Default is GROUP [Increment].
parentGroup: Optional. Boolean to parent the group. Default is false.
groupOpacity: Optional. Boolean to use group opacity. Default is false.
groupTrim: Optional. Boolean to use group trim. Default is false.
Layer object of the group header
This script creates a group and moves the group to the beginning of the composition.
Selects Workflower groups.
groupHeaders: Array of group header layer objects to be selected.
Nothing
Creates a matte to a given set of layers. On regular layers, creates a matte to them. On group headers, creates a group matte.
layers: Array of layer objects for the matte to be created to.
Layer object of the created matte
The exception to this is and which should execute the other comps properly when fed into the function.
The only exception to this is which lets you define whether you want Workflower to create undo groups or not.
excludeStartersFooters: Optional. Boolean to determine whether returning array should exclude Workflower's . Default is false.
Checks whether a given layer is within a with a certain ID (0 - 16). Added in script version 2.04 / API version 0.2.
Checks whether a given layer is within a with a certain name. Added in script version 2.04 / API version 0.2.
Executes a function, as specified by the function name. Names are identical to .
functionName: String of a function name to be executed. Names are identical to .
Allows to execute a function, as specified by the function name, via KBar's Run Scriplet feature. Names are identical to .
Since cannot execute via KBar's Run Scriptlet feature, wfAPI.kbarExecute() is needed instead.
functionName: String of a function name to be executed. Names are identical to .
doNotLabelLayersOutsideToNone: Optional. Sets the current comp to . Default is false. Added in script version 2.03 / API version 0.11.
doNotLabelLayersOutsideToNone: Optional. Sets the comps to . Default is false.