CompItem object

app.project.items[ index]


The CompItem object represents a composition, and allows you to manipulate and get information about it.
Access the objects by position index number in a project’s item collection.

• CompItem is a subclass of AVItem, which is a subclass of Item. All methods and attributes of AVItem and Item, in addition to those listed below, are available when working with CompItem. See AVItem object” and “Item object”.


Given that the first item in the project is a CompItem, the following code displays two alerts. The first shows the number of layers in the CompItem, and the second shows the name of the last layer in the CompItem.
var firstComp = app.project.item(1);
alert("number of layers is " + firstComp.numLayers);
alert("name of last layer is " + firstComp.layer(firstComp.numLayers).name);


Attribute Reference Description
frameDuration “CompItem frameDuration attribute” The duration of a single frame.
dropFrame “CompItem dropFrame attribute” When true, indicates that the composition uses drop-frame timecode.
workAreaStart “CompItem workAreaStart attribute” The work area start time.
workAreaDuration “CompItem workAreaDuration attribute” The work area duration.
numLayers “CompItem numLayers attribute” The number of layers in the composition.
hideShyLayers “CompItem hideShyLayers attribute” When true, shy layers are visible in the Timeline panel.
motionBlur “CompItem motionBlur attribute” When true, motion blur is enabled for this composition.
draft3d “CompItem draft3d attribute” When true, Draft 3D mode is enabled for the Composition panel.
frameBlending “CompItem frameBlending attribute” When true, time filtering is enabled for this composition.
preserveNestedFrameRate “CompItem preserveNestedFrameRate attribute” When true, the frame rate of nested compositions is preserved.
preserveNestedResolution “CompItem preserveNestedResolution attribute” When true, the resolution of nested compositions is preserved.
bgColor “CompItem bgColor attribute” The background color of the composition.
activeCamera “CompItem activeCamera attribute” The current active camera layer.

Attribute Reference Description
displayStartTime “CompItem displayStartTime attribute” Changes the display of the start time in the Timeline panel.
resolutionFactor “CompItem resolutionFactor attribute” The factor by which the x and y resolution of the Composition panel is downsampled.
shutterAngle “CompItem shutterAngle attribute” The camera shutter angle.
shutterPhase “CompItem shutterPhase attribute” The camera shutter phase.
motionBlurSamplesPerFrame “CompItem motionBlurSamplesPerFrame attribute” The minimum number of motion blur samples per frame for Classic 3D layers, shape layers, and certain effects.
motionBlurAdaptiveSampleLimit “CompItem motionBlurAdaptiveSample-Limit attribute” The maximum number of motion blur samples of 2D layer motion.
layers “CompItem layers attribute” “LayerCollection object” The layers of the composition.
selectedLayers “CompItem selectedLayers attribute” The selected layers of the composition.
selectedProperties “CompItem selectedProperties attribute” The selected properties of the composition.
renderer “CompItem renderer attribute” The rendering plug-in module to be used to render this composition.
renderers “CompItem renderers attribute” The set of available rendering plug-in modules.


Method Reference Description
duplicate() “CompItem duplicate() method” Creates and returns a duplicate of this composition.
layer() “CompItem layer() method” Gets a layer from this composition.
openInViewer() “CompItem openInViewer() method” Opens the composition in a Composition panel.

Other Tags

Posted in CompItem object and tagged , , , , , , , , , , , , , , , , , , , .