Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Add expression to selection of properties

  • Add expression to selection of properties

    Posted by Pascal Miller on January 23, 2018 at 10:16 pm

    Hello,
    I’m trying to write a script that will add the posterizeTime(); effect and add it to all selected properties. If a given property does not have an expression (say it only has keys), it will create the expression, and if there is an existing expression already there, it will add the posterizetime at the top of the expression (to preserve the existing expression)

    Is this hard?

    Thanks in advance!
    Pascal

    Pascal Miller replied 8 years, 7 months ago 2 Members · 2 Replies
  • 2 Replies
  • Andrei Popa

    January 25, 2018 at 10:28 pm

    This should not be so hard. Should look like thisif (layerProperty.expression == ''){ //the layer does not have an expression
    layerProperty.expression = yourExpression;
    }else{ //the layer already has an expression
    expr = layerProperty.expression;
    layerProperty.expression = yourExpression +'\n'+expr;
    }

    layerProperty should be the property you choose and yourExpression should be the expression you use. The ‘\n’ is used there as an empty line.

    Andrei
    My Envato portfolio.

  • Pascal Miller

    January 28, 2018 at 1:53 am

    Excellent thank you so much!!

    Pascal

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