Namespace

DuAEProject

DuAEProject

After Effects project methods

View Source Duik_api_fordoc.jsxinc, line 28874

Members

Object

# static settings

The Settings of the current project, an object similar to DuSettings except that it saves in the Project XMP

View Source Duik_api_fordoc.jsxinc, line 29675

Methods

# static autoFixExpressions(oldText, newText)

Reimplements app.project.autoFixExpressions() because it does not work with some special characters.
Automatically replaces text found in broken expressions in the project, if the new text causes the expression to evaluate without errors.
Parameters:
Name Type Description
oldText string The text to replace.
newText string The new text.

View Source Duik_api_fordoc.jsxinc, line 29429

# static bakeCompositions(modeopt, frameStepopt)

Bakes the expressions to keyframes
Parameters:
Name Type Attributes Default Description
mode DuAEExpression.BakeAlgorithm <optional>
DuAEExpression.BakeAlgorithm.SMART The algorithm to use for baking the expressions.
frameStep float <optional>
1.0 By default, checks one value per keyframe. A lower value increases the precision and allows for sub-frame sampling. A higher value is faster but less precise.

View Source Duik_api_fordoc.jsxinc, line 29545

# static bakeExpressions(modeopt, frameStepopt)

Bakes the expressions to keyframes
Parameters:
Name Type Attributes Default Description
mode DuAEExpression.BakeAlgorithm <optional>
DuAEExpression.BakeAlgorithm.SMART The algorithm to use for baking the expressions.
frameStep float <optional>
1.0 By default, checks one value per keyframe. A lower value increases the precision and allows for sub-frame sampling. A higher value is faster but less precise.

View Source Duik_api_fordoc.jsxinc, line 29534

# static checkCompNames() → {Object}

Checks if all comps have a different name.

View Source Duik_api_fordoc.jsxinc, line 29167

The list of names used several times. Check the length attribute to know how many duplicates were found, loop through the keys to get the names. Eech key is an array containing the list of comps with that name.
Object
Example
var dupes = DuAEProject.checkCompNames();
if (dupes.length != 0) {
for (name in dupes)
{
    if (dupes.hasOwnProperty(name)) alert(dupes[name]); //dupes[name] is an array of Layer
}
}

# static collectFiles(destinationopt, overwriteopt, zipopt, createProjectFolderopt)

Collects all dependencies in a folder
Parameters:
Name Type Attributes Default Description
destination Folder <optional>
The folder where to save the files. The project files will be collected in a subfolder called "project name.aep.archive" or "project name.aep.zip". If not provided, will use the current folder.
overwrite boolean <optional>
false Whether to overwrite existing footage in the destination.
zip boolean <optional>
false Set to true to automatically zip the archive.
createProjectFolder boolean <optional>
true Whether to create a folder for this project or use the destination as is.

View Source Duik_api_fordoc.jsxinc, line 29296

# static containsComp() → {bool}

Checks if the project contains at least one composition.

View Source Duik_api_fordoc.jsxinc, line 29555

bool

# static doComps(func, selectedOnlyopt)

Runs a function on all comps of the project
Parameters:
Name Type Attributes Default Description
func function The function, which must take a CompItem as its single argument.
selectedOnly Boolean <optional>
false Runs only on selected compositions

View Source Duik_api_fordoc.jsxinc, line 29084

# static expressionEngine() → {string}

The Expressions Engine setting in the Project Settings dialog box, as a string.

View Source Duik_api_fordoc.jsxinc, line 29206

One of: "extendscript", "javascript-1.0"
string

# static getActiveComp() → {CompItem|null}

Gets the After Effects current composition

View Source Duik_api_fordoc.jsxinc, line 29096

The current composition or null if there's no current comp
CompItem | null

# static getComps(rootOnlyopt) → {Array.<CompItem>}

Gets all compositions in the project (or only the root of the project, ignoring subfolders)
Parameters:
Name Type Attributes Default Description
rootOnly boolean <optional>
false Set to true to get only comps from the root of the project

View Source Duik_api_fordoc.jsxinc, line 29032

The compositions
Array.<CompItem>

# static getFolderItem(folderName) → {FolderItem|null}

Gets a folder with its name. If name is "Project Root" or empty, returns the root of the project.
Parameters:
Name Type Description
folderName string The name of the folder.

View Source Duik_api_fordoc.jsxinc, line 29461

The folder or null if not found.
FolderItem | null

# static getItemById() → {Item|null}

Retrieves an item by its Item ID

View Source Duik_api_fordoc.jsxinc, line 29112

The item
Item | null

# static getItemByName(name, folderopt) → {Item|null}

Retrieves the first item with the given name
Parameters:
Name Type Attributes Description
name string The name to search
folder FolderItem <optional>
A subfolder to search in

View Source Duik_api_fordoc.jsxinc, line 29129

The item
Item | null

# static getPrecompsAtRoot() → {Array.<CompItem>}

Gets all the precompositions located at the root of the project.

View Source Duik_api_fordoc.jsxinc, line 29510

Array.<CompItem>

# static getSelectedComp() → {CompItem|null}

Gets either the active comp or the first selected one

View Source Duik_api_fordoc.jsxinc, line 29063

The composition
CompItem | null

# static getSelectedComps() → {Array.<CompItem>}

Gets all selected compositions in the project

View Source Duik_api_fordoc.jsxinc, line 29049

The compositions
Array.<CompItem>

# static getSize() → {int}

Gets the size of the current project file

View Source Duik_api_fordoc.jsxinc, line 29195

the size in Bytes. -1 if it has not been saved yet.
int

# static getUnusedComps(folderopt) → {Array.<CompItem>}

Gets the unused compositions, except the ones in the given folder.
Parameters:
Name Type Attributes Description
folder FolderItem <optional>
The folder to exclude.

View Source Duik_api_fordoc.jsxinc, line 29482

The unused compositions
Array.<CompItem>

# static getUnusedFootages() → {Array.<FootageItem>}

Gets the unused footages.

View Source Duik_api_fordoc.jsxinc, line 29445

The list of unused items.
Array.<FootageItem>

# static name() → {string}

Gets the project name (i.e. the file name without extension)

View Source Duik_api_fordoc.jsxinc, line 29525

The project name.
string

# static newUniqueCompName(newName, comp, incrementopt) → {string}

Generates a new unique name for a composition
Parameters:
Name Type Attributes Default Description
newName string The wanted new name
comp CompItem The comp
increment boolean <optional>
true true to automatically increment the new name if it already ends with a digit

View Source Duik_api_fordoc.jsxinc, line 29146

The unique name, with a new number at the end if needed.
string

# static reduce(compsopt, keepExpressionOnlyopt)

Reduces the project, the same way the native command does it, but being able to keep comps used only by expressions.
Parameters:
Name Type Attributes Default Description
comps CompItem | Array.<CompItem> <optional>
The name or the id of the comp(s) to keep. If omitted, it will use all comps at the root of the project (the ones not in a subfolder).
keepExpressionOnly boolean <optional>
true Set to false to ignore comps used only by expressions (same as the native command)

View Source Duik_api_fordoc.jsxinc, line 29246

# static reduceSelected(keepExpressionOnlyopt)

Reduces the project using the selected compositions, the same way the native command does it, but being able to keep comps used only by expressions. If there's no comp selected, will use all comps at the root of the project.
Parameters:
Name Type Attributes Default Description
keepExpressionOnly boolean <optional>
true Set to false to ignore comps used only by expressions (same as the native command)

View Source Duik_api_fordoc.jsxinc, line 29232

# static replaceInExpressions(oldString, newString, caseSensitiveopt)

Replaces text in Expressions
Parameters:
Name Type Attributes Default Description
oldString string The string to replace
newString string The new string
caseSensitive boolean <optional>
true Whether the search has to be case sensitive

View Source Duik_api_fordoc.jsxinc, line 29411

# static setProgressMode(inProgressopt, showProgressBaropt, askToHideLayerControlsopt, eventCoordinatesopt) → {Boolean}

Sets the project in "waiting mode" to speed up things.
Parameters:
Name Type Attributes Default Description
inProgress Boolean <optional>
true True to set progress mode, false to stop it.
showProgressBar Boolean <optional>
true Will show a nice progress bar if true
askToHideLayerControls Boolean <optional>
false Will prompt the user to hide layer controls to improve performance.
eventCoordinates Array.<int> <optional>
Provide the screen coordinates to center the progress bar and dialogs on the corresponding screen.

View Source Duik_api_fordoc.jsxinc, line 28890

false if the user cancelled the process, true otherwise
Boolean

# static setUniqueCompNames(compsopt)

Makes sure all compositions in the project have unique names, renaming them if needed.
Parameters:
Name Type Attributes Description
comps Array | ItemCollection <optional>
A list of comps, all of them by default

View Source Duik_api_fordoc.jsxinc, line 29216