Page 1 of 1

accessing expressions from scrpts

Posted: June 26th, 2008, 1:38 am
by Redsandro
Hi,

I'm looking for a way to quickly replace a lot of layer references in expressions to another layer. I know javascript, and the AE help provides information on AE methods. But I did not find information on accessing/editing expressions.

Is this possible? I'd like to use app.project.activeItem.selectedLayers to traverse all properties with expressions, and go javascript replace() on it for a regular expression find-and-replace.

Re: accessing expressions from scrpts

Posted: June 26th, 2008, 2:31 am
by Mylenium
Read the scripting guide again. Expressions are simply layer properties and can be added using layer.property and layer.property.expression or something like that. Still not particularly convenient, as you have to add all the extra stuff for line breaks and special characters inside the expression string...

Mylenium

Re: accessing expressions from scrpts

Posted: June 26th, 2008, 4:54 am
by Redsandro
Just strings? Hmm.. that's easy. Somehow I missed that.
Also just replacing names won't require me to handle linebreaks. I'm lucky for now.