Namespace

DuAEProject

DuAEProject

After Effects project methods

View Source DuAEF.jsxinc, line 29090

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 DuAEF.jsxinc, line 29895

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 DuAEF.jsxinc, line 29645

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

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

# static checkCompNames() → {Object}

Checks if all comps have a different name.

View Source DuAEF.jsxinc, line 29383

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

# static containsComp() → {bool}

Checks if the project contains at least one composition.

View Source DuAEF.jsxinc, line 29771

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 DuAEF.jsxinc, line 29300

# static expressionEngine() → {string}

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

View Source DuAEF.jsxinc, line 29422

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

# static getActiveComp() → {CompItem|null}

Gets the After Effects current composition

View Source DuAEF.jsxinc, line 29312

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

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

The folder or null if not found.
FolderItem | null

# static getItemById() → {Item|null}

Retrieves an item by its Item ID

View Source DuAEF.jsxinc, line 29328

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 DuAEF.jsxinc, line 29345

The item
Item | null

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

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

View Source DuAEF.jsxinc, line 29726

Array.<CompItem>

# static getSelectedComp() → {CompItem|null}

Gets either the active comp or the first selected one

View Source DuAEF.jsxinc, line 29279

The composition
CompItem | null

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

Gets all selected compositions in the project

View Source DuAEF.jsxinc, line 29265

The compositions
Array.<CompItem>

# static getSize() → {int}

Gets the size of the current project file

View Source DuAEF.jsxinc, line 29411

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

The unused compositions
Array.<CompItem>

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

Gets the unused footages.

View Source DuAEF.jsxinc, line 29661

The list of unused items.
Array.<FootageItem>

# static name() → {string}

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

View Source DuAEF.jsxinc, line 29741

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

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

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

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

# 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 DuAEF.jsxinc, line 29106

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 DuAEF.jsxinc, line 29432