Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Show a property using Extendscript

  • Fabrice Leconte

    February 13, 2021 at 2:13 pm

    Hello, you can use

    rd_GimmePropPath.jsx

    http://redefinery.com/ae/scripts/rd_scripts_20170108.zip

  • Filip Vandueren

    February 14, 2021 at 10:42 pm

    I just came up with this hack:

    // prop we want to reveal:
    prop = app.project.item(1).layer("Shape Layer 1")("Contents")("Shape 1")("Contents")("Path 1")("Path");
    // reveal in timeline Hack:
    originalExpression = prop.expression;
    prop.expression= "1/0"; // create an expression error
    //reveal expression errors:
    app.executeCommand( app.findMenuCommandId("Reveal Expression Errors") );
    $.sleep(1); // wait 1 ms
    // reset expression to previous value
    prop.expression = originalExpression;

    It does seem to hide the properties that were previously visible though…

  • Avinash Ramanath

    February 16, 2021 at 2:05 am

    Thanks for your effort on this. Running this code exposes the path property. Is there any way I can show its parent – Path 1 and make its state as selected? Fingers crossed.

  • Avinash Ramanath

    February 16, 2021 at 2:06 am

    Thanks but I wanted the Path 1 attribute exposed so that I can select its leads and modify it

  • Filip Vandueren

    February 16, 2021 at 7:39 am

    No, the hack only works on properties that have canSetExpressiom=true

    And it is a hack, there’s no official way to show or hide anything in the timeline via scripting.

  • Filip Vandueren

    February 16, 2021 at 7:40 am

    What do you mean by “set its leads”?

  • Avinash Ramanath

    February 16, 2021 at 8:32 am

    OK, thanks very much for trying. I will use this hack sometime in the future.

  • Anton Shushar

    April 7, 2022 at 8:45 pm

    I modified Filip’s code a bit to support multiple properties. You just need to pass as many properties as you need into revealProperty function as arguments

    Here’s small working example:

    var curComp = app.project.activeItem;
    var curLayer = curComp.selectedLayers[0];

    revealProperty(curLayer.opacity, curLayer.scale);

    function revealProperty(){
     var originalExpressions = [], prop = arguments;
     for(i=0; i<prop.length; i++){
      originalExpressions.push(prop[i].expression);
      prop[i].expression= "1/0";
     }
     app.executeCommand(app.findMenuCommandId("Reveal Expression Errors"));
     $.sleep(1);
     for(i=0; i<prop.length; i++){
      prop[i].expression = originalExpressions[i];
     }
    }

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