app.project.item(index).layers.precompose(layerIndicies,name,moveAllAttributes)
Description
Creates a new CompItem object and moves the specified layers into its layer collection. It removes the individual layers from this collection, and adds the new CompItem to this collection.
Parameters
layerIndices The position indexes of the layers to be collected. An array of integers.
name The name of the new CompItem object.
moveAllAttributes Optional. When true (the default), retains all attributes in the new composition.
This is the same as selecting the Move all attributes into the new composition option in the Pre-compose dialog box.
You can only set this to false if there is just one index in the laye rIndi ces array.
This is the same as selecting the “Leave all attributes in” option in the Pre-compose dialog box.
Returns
CompItem object.