ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Batch edit expressions with script

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Trirat Homchantra
Batch edit expressions with script
on Oct 29, 2016 at 9:48:08 am


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:, so if the layer control accidentally selects none or other layer, it will use the default color settings until the correct layer is selected.

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.


Return to posts index

James Nielson
Re: Batch edit expressions with script
on Mar 10, 2017 at 7:01:17 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

Return to posts index

Dan Ebberts
Re: Batch edit expressions with script
on Mar 10, 2017 at 7:19:00 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.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved