ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Does anybody know how to isolate the name — not the value — of a given variable?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Teague Chrystie
Does anybody know how to isolate the name — not the value — of a given variable?
on May 2, 2018 at 10:46:17 pm
Last Edited By Teague Chrystie on May 2, 2018 at 11:40:51 pm

Hey folks, hope all is well. I'm trying to write a function in a sourceText expression which would basically look like this:

function exampleFunction(exampleInput){

string = exampleInput.name + "~" + exampleInput.value;
return string

}

Thus, if I had a variable named creativeCow with a value of 99, calling exampleFunction(creativeCow) would return "creativeCow~99" as that layer's text output.

This is one of those things where I just typed it out assuming the syntax would be there, and it took me a minute to realize that apparently... it's... just not possible?

Am I nuts?

Thanks.


Return to posts index

Andrei Popa
Re: Does anybody know how to isolate the name — not the value — of a given variable?
on May 3, 2018 at 1:35:30 pm

I don't think you can call a variable name in javascript. If, however, you put an object in there, like opacity, it works just fine. I think you need an object that has the .name and the .value properties. It also does not work if your value is an array, since javascript doesn't convert the array into string before concatenating.

Andrei
My Envato portfolio.


Return to posts index

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