## DuAE

After Effects general tools

View Source Duik_api_fordoc.jsxinc, line 20102

# Members

Type: `int`

#### # static readonly Axis

The axis or channels

##### Properties:

Name | Type | Description
--- | --- | ---
`X` | `int` |
`Y` | `int` |
`Z` | `int` |
`RED` | `int` |
`GREEN` | `int` |
`BLUE` | `int` |
`ALPHA` | `int` |
`HUE` | `int` |
`SATURATION` | `int` |
`VALUE` | `int` |

View Source Duik_api_fordoc.jsxinc, line 20109

#### # static readonly ColorLabels

Default color labels

To Do:
  - get real labels (from pref file?)

View Source Duik_api_fordoc.jsxinc, line 20568

Type: `Object`

#### # static CompactExpression

Associative array that converts property match names to their compact English expression statements.

View Source Duik_api_fordoc.jsxinc, line 20168

##### Example

    DuAE.CompactExpression["ADBE Transform Group"]
    //returns "'transform'"

Type: `DuList`

#### # static DuAELayeredFileType

List of file extensions whih may be imported as several items with the same source

View Source Duik_api_fordoc.jsxinc, line 20547

Type: `string`

#### # static readonly LayerAttribute

Attributes of layers in Ae

##### Properties:

Name | Type | Description
--- | --- | ---
`SELECTED` | `string` |
`VISIBLE` | `string` |
`AUDIO` | `string` |
`SOLO` | `string` |
`LOCKED` | `string` |
`SHY` | `string` |
`EFFECTS_ENABLED` | `string` |
`MOTION_BLUR` | `string` |
`THREE_D` | `string` |
`GUIDE` | `string` |

View Source Duik_api_fordoc.jsxinc, line 20489

Type: `int`

#### # static readonly LayerPlacement

How to place new layers

##### Properties:

Name | Type | Description
--- | --- | ---
`BOTTOM` | `int` |
`UNDER_LAYER` | `int` |
`ABOVE_LAYER` | `int` |
`TOP` | `int` |

View Source Duik_api_fordoc.jsxinc, line 20460

Type: `string`

#### # static readonly LayerType

Types of layers used by Ae

##### Properties:

Name | Type | Description
--- | --- | ---
`NULL` | `string` |
`SOLID` | `string` |
`SHAPE` | `string` |
`TEXT` | `string` |
`ADJUSTMENT` | `string` |
`LIGHT` | `string` |
`CAMERA` | `string` |

View Source Duik_api_fordoc.jsxinc, line 20473

Type: `string`

#### # static readonly LoopType

Loop types

##### Properties:

Name | Type | Description
--- | --- | ---
`HOLD` | `string` |
`NONE` | `string` |
`CYCLE` | `string` |
`PINGPONG` | `string` |
`OFFSET` | `string` |
`CONTINUE` | `string` |

View Source Duik_api_fordoc.jsxinc, line 20508

Type: `int`

#### # static readonly MenuCommandID

Menu Command Ids
These are the ids which can be found using `app.findMenuCommandID("insertMenuNameHere");`
Use `app.executeCommand(id)` to run them.

##### Properties:

Name | Type | Description
--- | --- | ---
`CUT` | `int` |
`COPY` | `int` |
`COPY_WITH_PROPERTY_LINKS` | `int` |
`PASTE` | `int` |
`DUPLICATE` | `int` |
`UNDO` | `int` |
`GENERAL_PREFERENCES` | `int` |
`SCRIPTING_PREFERENCES` | `int` |
`LAYER_CONTROLS` | `int` |
`REVEAL_EXPRESSION_ERRORS` | `int` |
`CONVERT_AUDIO_TO_KEYFRAMES` | `int` |

View Source Duik_api_fordoc.jsxinc, line 20439

##### Example

    app.executeCommand(DuAE.MenuCommandID.COPY); //copies the selection
    app.executeCommand(DuAE.MenuCommandID.PASTE); //pastes the selection

Type: `int`

#### # static readonly PrefType

The type of AE preferences

##### Properties:

Name | Type | Description
--- | --- | ---
`BOOL` | `int` |
`STRING` | `int` |
`FLOAT` | `int` |
`LONG` | `int` |

View Source Duik_api_fordoc.jsxinc, line 20535

Type: `int`

#### # static readonly SelectionMode

Enum for selections

##### Properties:

Name | Type | Description
--- | --- | ---
`SELECTED_PROPERTIES` | `int` |
`SELECTED_LAYERS` | `int` |
`ACTIVE_COMPOSITION` | `int` |
`SELECTED_COMPOSITIONS` | `int` |
`ALL_COMPOSITIONS` | `int` |

View Source Duik_api_fordoc.jsxinc, line 20555

Type: `string`

#### # static readonly TimeAlignment

How to align in time

##### Properties:

Name | Type | Description
--- | --- | ---
`CENTER` | `string` |
`IN_POINT` | `string` |
`OUT_POINT` | `string` |

View Source Duik_api_fordoc.jsxinc, line 20523

Type: `int`

#### # static readonly Type

Types of values

##### Properties:

Name | Type | Description
--- | --- | ---
`VALUE` | `int` |
`SPEED` | `int` |
`VELOCITY` | `int` |

View Source Duik_api_fordoc.jsxinc, line 20128

Type: `string`

#### # static readonly Unit

Abbreviated units used in the UI.
These strings are localized based on internal After Effects dictionnaries.

##### Properties:

Name | Type | Description
--- | --- | ---
`PIXELS` | `string` |
`DEGREES` | `string` |
`PERCENT` | `string` |

View Source Duik_api_fordoc.jsxinc, line 20141

Type: `string`

#### # static readonly UnitText

Units used in the UI
These strings are localized based on internal After Effects dictionnaries.

##### Properties:

Name | Type | Description
--- | --- | ---
`PERCENT` | `string` |
`DEGREES` | `string` |
`PIXELS` | `string` |

View Source Duik_api_fordoc.jsxinc, line 20154

Type: `DuVersion`

#### # static readonly version

Informations about the version of after effects.

View Source Duik_api_fordoc.jsxinc, line 20683

# Methods

#### # static beginUndoGroup(groupName, autoCloseopt)

Begins an undoGroup.
Automatically prepend the group name with the script name.
Using this method is safer than the native one, as DuAEF will try to avoid opening several undo groups at once.
The group name is translatable.

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`groupName` | `string` |  |  | The name of the Undo Group.
`autoClose` | `boolean` | <optional> | true | By default, DuAEF will close any previously opened undogroup (which has a different name) to prevent any error. Set this to `false` in order to ignore this new group beginning and keep the previously opened one.

View Source Duik_api_fordoc.jsxinc, line 20803

#### # static convertCollectionToArray(collection) → {Array}

Converts an AE Collection to an Array
This method is deprecated, you should use a `DuList` otherwise

##### Parameters:

Name | Type | Description
--- | --- | ---
`collection` | `Array` | `Collection` | The collection to convert

Deprecated:
  - Yes

View Source Duik_api_fordoc.jsxinc, line 20988

Returns:
The array
Type: `Array`

#### # static copy()

Copies the selection (runs the copy menu command)

View Source Duik_api_fordoc.jsxinc, line 20876

#### # static copyWithPropertyLinks()

Copies the selection with property links (runs the copy menu command)
Only on versions of After Effects greater than 11.0 (CS6)
On CS6 and below, a standard copy will be done.

View Source Duik_api_fordoc.jsxinc, line 20892

#### # static cut()

Cuts the selection (runs the cut menu command)

View Source Duik_api_fordoc.jsxinc, line 20869

#### # static duplicate()

Duplcates the selection (runs the duplicate menu command)

View Source Duik_api_fordoc.jsxinc, line 20883

#### # static endUndoGroup(groupNameopt)

Ends an undoGroup.
Using this method is safer than the native one, as DuAEF will try to avoid opening several undo groups at once.

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`groupName` | `string` | <optional> | The name of the Undo Group to end. Use this if you used `DuAE.beginUndoGroup` with the 'autoClose' argument set to false before.

View Source Duik_api_fordoc.jsxinc, line 20823

#### # static executeCommand(commandID)

Runs app.executeCommand in a safer way, taking care of undogroups.

##### Parameters:

Name | Type | Description
--- | --- | ---
`commandID` | `int` | `string` | The ID of the command as given by app.findMenuCommandID(), or if it is a string, the name of the command.

View Source Duik_api_fordoc.jsxinc, line 20834

#### # static getAeRender() → {File|null}

Gets the aerender binary

View Source Duik_api_fordoc.jsxinc, line 20776

Returns:
The aerender binary, or null if not found
Type: `File` | `null`

#### # static getAEVersion(versionAsFloatopt) → {DuVersion}

Gets the version of After Effects from its public name (like 13.8 for CC2015.3)

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`versionAsFloat` | `float` | <optional> | The version name.

View Source Duik_api_fordoc.jsxinc, line 20729

Returns:
The version.
Type: `DuVersion`

#### # static getAEVersionName(versionAsFloatopt) → {string}

Gets the public name of a version of After Effects (like CC2015.3 for version 13.8)

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`versionAsFloat` | `float` | <optional> | The version as a float. If not provided, will default to the current version of the running instance of After Effects.

View Source Duik_api_fordoc.jsxinc, line 20699

Returns:
The version name.
Type: `string`

#### # static getCompactExpression(matchName, nameopt, propopt)

Gets the compact expression synonym of a matchName

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`matchName` | `string` |  | The matchName of a property
`name` | `string` | <optional> | A replacement name (or index) in case the compact expression does not exist. If omitted, the matchName will be used.
`prop` | `Proeprty` | <optional> | The original property; may be needed to differenciate between 3D layers / cam / lights, etc

View Source Duik_api_fordoc.jsxinc, line 20593

#### # static getDuAEProperty(props) → {Array.<DuAEProperty>}

Gets the DuAEProperty for the properties

##### Parameters:

Name | Type | Description
--- | --- | ---
`props` | `Array.<PropertyBase>` | The Properties

View Source Duik_api_fordoc.jsxinc, line 20653

Returns:
The info
Type: `Array.<DuAEProperty>`

#### # static getPref(section, key, fileopt, typeopt) → {any|null}

Gets a pref

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`section` | `string` |  |  | The section of the preferences
`key` | `string` |  |  | The key
`file` | `PREFType` | <optional> | PREFType.PREF_Type_MACHINE_SPECIFIC | The preference file, from the `PREFType` enum value of the After Effects API
`type` | `DuAE.PrefType` | <optional> | DuAE.PrefType.STRING | The type of the preference to return

View Source Duik_api_fordoc.jsxinc, line 20629

Returns:
The pref or null if it does not exists
Type: `any` | `null`

#### # static hasPref(section, key, fileopt) → {Boolean}

Checks if After Effects has the given preference

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`section` | `string` |  |  | The section of the preferences
`key` | `string` |  |  | The key
`file` | `PREFType` | <optional> | PREFType.PREF_Type_MACHINE_SPECIFIC | The preference file, from the `PREFType` enum value of the After Effects API

View Source Duik_api_fordoc.jsxinc, line 20613

Returns:
true if the pref exists
Type: `Boolean`

#### # static isAutoSaveFolder(folder) → {boolean}

Checks if the Folder is an Auto-Save folder

##### Parameters:

Name | Type | Description
--- | --- | ---
`folder` | `Folder` | `string` | The folder or path to check

View Source Duik_api_fordoc.jsxinc, line 20916

Returns:
true if the folder is an auto-save folder
Type: `boolean`

#### # static isDebuggerEnabled() → {Boolean}

Checks if the javascript debugger is enabled

View Source Duik_api_fordoc.jsxinc, line 20689

Returns:
true if the debugger is enabled.
Type: `Boolean`

#### # static isLayeredFile(fileopt) → {boolean}

Checks if the file is a layered type (psd, ai, psb, fla...)

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`file` | `String` | `File` | <optional> | The file or the path

View Source Duik_api_fordoc.jsxinc, line 20672

Returns:
true if it's a layered file
Type: `boolean`

#### # static isVersionAtLeast(versionName) → {boolean}

Checks if the current version is at least a given one

##### Parameters:

Name | Type | Description
--- | --- | ---
`versionName` | `string` | The minimum version

View Source Duik_api_fordoc.jsxinc, line 20767

Returns:
True if the current version is higher or the same
Type: `boolean`

#### # static isVersionHigherThan(versionName) → {boolean}

Checks if the current version is higher than a given one

##### Parameters:

Name | Type | Description
--- | --- | ---
`versionName` | `string` | The minimum version

View Source Duik_api_fordoc.jsxinc, line 20757

Returns:
True if the current version is higher (strict, will be false if they're equal)
Type: `boolean`

#### # static openScriptUIPanel(panelScriptName)

Opens a ScriptUI Panel if it is installed, or displays an alert otherwise.

##### Parameters:

Name | Type | Description
--- | --- | ---
`panelScriptName` | `string` | The Script name of the panel "script.jsx"

View Source Duik_api_fordoc.jsxinc, line 20849

#### # static paste()

Pastes the selection (runs the paste menu command)

View Source Duik_api_fordoc.jsxinc, line 20900

#### # static scriptFolders(suboflderopt) → {Array.<Folder>}

Gets the list of folders where scripts may be installed

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`suboflder` | `string` | <optional> | The name of a subfolder, like "ScriptUI Panels" or "Startup" or "Shutdown"...

View Source Duik_api_fordoc.jsxinc, line 20945

Returns:
the list of Folder objects.
Type: `Array.<Folder>`

#### # static toggleLayerControls()

Shows/hides the layer controls

View Source Duik_api_fordoc.jsxinc, line 20936

#### # static undo()

Undoes (runs the undo command)

View Source Duik_api_fordoc.jsxinc, line 20907