Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Scripting Help Needed! Expanding Layer’s Contents in Timeline Panel

  • Scripting Help Needed! Expanding Layer’s Contents in Timeline Panel

    Posted by Brayden Blythe on October 28, 2024 at 5:02 pm

    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;

    }

    }

    }

    }

    Dan Ebberts replied 5 months, 4 weeks ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    October 30, 2024 at 8:25 pm

    I don’t know of a direct way, but you might be able to come up with a hack where you make sure just that layer is selected, add add a bad expression to the path, then do something like this:

    app.executeCommand(app.findMenuCommandId("Reveal Expression Errors"));

    then delete the expression.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy