Copy link to clipboard
Copied
Three new, highly requested APIs have been added to the Scripting DOM:
All available in AE Beta versions 22x25 or newer.
Here's An In-Depth Look At Each API:
Layer.id
app.project.item(index).layer(index).id
Description
Instance property on Layer which returns a unique and persistent identification number used internally to identify a Layer between sessions. The value of the ID remains the same when the project is saved to a file and later reloaded. However, when you import this project into another project, new IDs are assigned to all Layers in the imported project. The ID is not displayed anywhere in the user interface.
Type
Integer; read-only.
Project.layerByID
app.project.layerByID(id)
Description
Instance method on Project which, when given a valid ID value, returns the Layer object on the Project with that given ID.
Parameters
name description
id | A non-negative integer representing the ID of the Layer to be retrieved from the Project |
Returns
Layer object with the given ID if it exists on the project; otherwise null. Non-valid IDs will throw an exception stating that the input parameter is not an unsigned integer.
Example
var firstComp = app.project.item(1);
var firstLayer = firstComp.layer(1);
var layerID = firstLayer.id;
if (app.project.layerByID(layerID) === firstLayer) {
alert("You can get the Layer from the ID!");
}
Property.essentialPropertySource
app.project.item(index).layer(index).essentialProperty.property(index).essentialPropertySource
Description
Instance property on an Essential Property object which returns the original source Property which was used to create the Essential Property.
Type
Can return either:
Example
var firstComp = app.project.item(1);
var opacityProp = firstComp.layer(1).property("Transform").property("Opacity");
opacityProp.addToMotionGraphicsTemplate(firstComp);
var secondComp = app.project.item(2);
secondComp.layers.add(firstComp);
var essentialOpacity = secondComp.layer(1).essentialProperty.property(1);
if (essentialOpacity.essentialPropertySource == opacityProp) {
alert("You can get the source Property from an Essential Property!");
}
Have something to add?