FORUMS: list search recent posts

Access string without quotes

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Steve Sierra
Access string without quotes
on Apr 14, 2017 at 5:08:13 am

Hi,

I need to get a comp name and put it in an expression via scripting.
The problem is that the comp name seems to be given with double quotes, and, as far as I know, expressions via scripting require simple quotes...
I can work around the problem by renaming the comp, but I'd prefer leaving it as is, in case it is referenced in another expression.
I tried changing the name for my script then re-changing it back at the end + applying autoFixExpressions, but it didn't work.

Thanks !;)


Return to posts index

Dan Ebberts
Re: Access string without quotes
on Apr 14, 2017 at 6:47:17 am

If you want to include double quotes in the expression, you can wrap the expression in single quotes in the script. For example:

var myExpr = 'comp("Comp 1").layer("Layer 1").transform.position';

Dan



Return to posts index

Steve Sierra
Re: Access string without quotes
on Apr 14, 2017 at 8:20:27 am

Great !

Thanks again Dan ;)


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]