Namespace

DuAEProject

DuAEProject

After Effects project methods

View Source DuAEF_DuSan_api.jsxinc, line 24979

Members

# static settings

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

View Source DuAEF_DuSan_api.jsxinc, line 25628

Methods

# 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 DuAEF_DuSan_api.jsxinc, line 25512

# 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 DuAEF_DuSan_api.jsxinc, line 25501

# static checkCompNames() → {Object}

Checks if all comps have a different name.

View Source DuAEF_DuSan_api.jsxinc, line 25160

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 DuAEF_DuSan_api.jsxinc, line 25289

# 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 DuAEF_DuSan_api.jsxinc, line 25081

# static expressionEngine() → {string}

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

View Source DuAEF_DuSan_api.jsxinc, line 25199

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

# static getActiveComp() → {CompItem|null}

Gets the After Effects current composition

View Source DuAEF_DuSan_api.jsxinc, line 25093

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 DuAEF_DuSan_api.jsxinc, line 25029

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 DuAEF_DuSan_api.jsxinc, line 25436

The folder or null if not found.
FolderItem | null

# static getItemById() → {Item|null}

Retrieves an item by its Item ID

View Source DuAEF_DuSan_api.jsxinc, line 25109

The item
Item | null

# static getItemByName() → {Item|null}

Retrieves the first item with the given name

View Source DuAEF_DuSan_api.jsxinc, line 25124

The item
Item | null

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

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

View Source DuAEF_DuSan_api.jsxinc, line 25477

Array.<CompItem>

# static getSelectedComp() → {CompItem|null}

Gets either the active comp or the first selected one

View Source DuAEF_DuSan_api.jsxinc, line 25060

The composition
CompItem | null

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

Gets all selected compositions in the project

View Source DuAEF_DuSan_api.jsxinc, line 25046

The compositions
Array.<CompItem>

# static getSize() → {int}

Gets the size of the current project file

View Source DuAEF_DuSan_api.jsxinc, line 25188

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 DuAEF_DuSan_api.jsxinc, line 25457

The unused compositions
Array.<CompItem>

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

Gets the unused footages.

View Source DuAEF_DuSan_api.jsxinc, line 25420

The list of unused items.
Array.<FootageItem>

# static name() → {string}

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

View Source DuAEF_DuSan_api.jsxinc, line 25492

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 DuAEF_DuSan_api.jsxinc, line 25139

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 DuAEF_DuSan_api.jsxinc, line 25239

# 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 DuAEF_DuSan_api.jsxinc, line 25225

# 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 DuAEF_DuSan_api.jsxinc, line 25404

# static setProgressMode(inProgressopt, showProgressBaropt)

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

View Source DuAEF_DuSan_api.jsxinc, line 24990

# 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 DuAEF_DuSan_api.jsxinc, line 25209