-
Scripting Help Needed! Expanding Layer’s Contents in Timeline Panel
Hello AE scripters! I’m trying to write a quick script that will open a shape layer’s path property.
I work with paths frequently and want to assign a keyboard shortcut to open the “Path” property, just like P would for position, for example.I’ve written a script that will select that Path group, but that’s the best I can do right now. I’d like to go one level deeper, so that it selects the Path property, not just the group. Also, I’d like the layer to reveal the path property in the timeline, not just selecting it (in the “unopened” layer). I have not been able to find a way to actually expand (or “open”) the layer’s contents with any sort of precision. Any/all help is welcome!
var comp = app.project.activeItem;
if (comp && comp instanceof CompItem && comp.selectedLayers.length > 0) {
var activeLayer = comp.selectedLayers[0];
if (activeLayer instanceof ShapeLayer) {
var shapeGroup = activeLayer.property(“ADBE Root Vectors Group”);
if (shapeGroup && shapeGroup.numProperties > 0) {
for (var i = 1; i <= shapeGroup.numProperties; i++) {
var property = shapeGroup.property(i);
if (property.matchName === “ADBE Vector Shape – Group”) {
property.selected = true;
break;
}
}
}
}