Page 1 of 1

How can I avoid using 'eval()'?

Posted: April 14th, 2015, 5:28 pm
by blastframe
Hello,
I'm trying to get After Effects to see a property path string (i.e. ('Contents')('Group 1')('Contents')('Rectangle 1')('Contents')('Rectangle Path 1')('Position’)) as a property.

I can do this with eval(), but I have been told that this is bad practice and could be potentially used maliciously.

In my research for avoiding eval(), I've seen people suggesting passing strings to 'window' which allows the browser to recognize a function, variable, or whatever. Does something similar exist for After Effects and ExtendScript? If not, how can I get After Effects to see a string as a property path?

Thanks! :)