How can I avoid using 'eval()'?

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
User avatar
blastframe
Posts: 5
Joined: January 1st, 2015, 1:11 am
Location: San Francisco, CA
Contact:

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! :)
Post Reply