## DuAEProject

After Effects project methods

View Source DuAEF_Duik_api.jsxinc, line 24974

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

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

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

#### # static checkCompNames() → {Object}

Checks if all comps have a different name.

View Source DuAEF_Duik_api.jsxinc, line 25155

Returns:
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.
Type: `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_Duik_api.jsxinc, line 25284

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

#### # static expressionEngine() → {string}

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

View Source DuAEF_Duik_api.jsxinc, line 25194

Returns:
One of: "extendscript", "javascript-1.0"
Type: `string`

#### # static getActiveComp() → {CompItem|null}

Gets the After Effects current composition

View Source DuAEF_Duik_api.jsxinc, line 25088

Returns:
The current composition or null if there's no current comp
Type: `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_Duik_api.jsxinc, line 25024

Returns:
The compositions
Type: `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_Duik_api.jsxinc, line 25431

Returns:
The folder or null if not found.
Type: `FolderItem` | `null`

#### # static getItemById() → {Item|null}

Retrieves an item by its Item ID

View Source DuAEF_Duik_api.jsxinc, line 25104

Returns:
The item
Type: `Item` | `null`

#### # static getItemByName() → {Item|null}

Retrieves the first item with the given name

View Source DuAEF_Duik_api.jsxinc, line 25119

Returns:
The item
Type: `Item` | `null`

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

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

View Source DuAEF_Duik_api.jsxinc, line 25472

Returns:
Type: `Array.<CompItem>`

#### # static getSelectedComp() → {CompItem|null}

Gets either the active comp or the first selected one

View Source DuAEF_Duik_api.jsxinc, line 25055

Returns:
The composition
Type: `CompItem` | `null`

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

Gets all selected compositions in the project

View Source DuAEF_Duik_api.jsxinc, line 25041

Returns:
The compositions
Type: `Array.<CompItem>`

#### # static getSize() → {int}

Gets the size of the current project file

View Source DuAEF_Duik_api.jsxinc, line 25183

Returns:
the size in Bytes. -1 if it has not been saved yet.
Type: `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_Duik_api.jsxinc, line 25452

Returns:
The unused compositions
Type: `Array.<CompItem>`

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

Gets the unused footages.

View Source DuAEF_Duik_api.jsxinc, line 25415

Returns:
The list of unused items.
Type: `Array.<FootageItem>`

#### # static name() → {string}

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

View Source DuAEF_Duik_api.jsxinc, line 25487

Returns:
The project name.
Type: `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_Duik_api.jsxinc, line 25134

Returns:
The unique name, with a new number at the end if needed.
Type: `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_Duik_api.jsxinc, line 25234

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

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

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

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