Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Batch edit expressions with script

  • Batch edit expressions with script

    Posted by Trirat Homchantra on October 29, 2016 at 9:48 am

    Hi,

    I’m currently working on After Effects project with color preset options, which is basically a Layer Control that selects layer with Expression Controls and load its color values, sliders, etc.

    This is the first expression I used:


    comp("Main Comp").layer("Color Scheme").effect("Color Scheme Preset")("Layer").effect("Artist Color")("Color")

    Though I realized later this expression will break if the layer control is select at any layer other than the one with correct color controls. I rewrite the first expression to try and catch (adapted from Dan’s reply: https://forums.creativecow.net/thread/227/26810), so if the layer control accidentally selects none or other layer, it will use the default color settings until the correct layer is selected.


    try{
    L = comp("Main Comp").layer("Color Scheme").effect("Color Scheme")("Layer");
    prefix = L.effect("Artist Color")("Color");
    }catch (err){
    prefix = comp("Main Comp").layer("Preset 0 - Default").effect("Artist Color")("Color") ;
    }

    Unfortunately, I have around 50 project files to update to this new expression. I was wondering if batch editing expression is possible with scripting, to make the script reads the old expression, then use it as reference to write a new one.

    Any feedback is appreciated.

    Trirat

    Dan Ebberts replied 9 years, 2 months ago 3 Members · 2 Replies
  • 2 Replies
  • James Nielson

    March 10, 2017 at 7:01 am

    In case you haven’t finished editing your expressions one by one (5 months later), one solution I found is pt_Express_Edit

    James Nielson
    http://www.x-dissolve.net

  • Dan Ebberts

    March 10, 2017 at 7:19 am

    It’s certainly possible, especially if the expression is located on the same layer in each project. You’d basically retrieve the old expression, construct the new one around it, and replace the old expression with the new one. Not too tough.

    Dan

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