Skip to main content
Participant
January 15, 2012
Answered

Calling an expression that's stored in one place (like a link, or an "include")

  • January 15, 2012
  • 1 reply
  • 1018 views

I would like to make an expression (for use on various layers throughout multiple comps) that triggers a main expression that's stored in one place.. (maybe this would be an expression on a layer on some unused dummy comp or as a text file, if possible).

In terms of programming this is like using an include file.

Is something like this possible? The purpose is to allow editing all the instances from one place.

Thanks

This topic has been closed for replies.
Correct answer Dan Ebberts

if you store your expression in a text layer (named "expression_layer" in this example), you can execute it with the JavaScript eval() function, like this:

eval(thisComp.layer("expression_layer").text.sourceText.value)

Dan

1 reply

Dan Ebberts
Community Expert
Dan EbbertsCommunity ExpertCorrect answer
Community Expert
January 15, 2012

if you store your expression in a text layer (named "expression_layer" in this example), you can execute it with the JavaScript eval() function, like this:

eval(thisComp.layer("expression_layer").text.sourceText.value)

Dan

Participant
January 16, 2012

Perfect, thanks a lot