AE20200: Use multiple style.set expressions - not working
Greetings all,
I'm trying to make use of the new expressions (in JavaScript mode if that helps) to parent text styles between compositions, but I keep running into problems. I've managed to come up with an expression that works when it's by itself, but when I try to stack them like I've seen others do, I get an error starting with the second line: "style.set[whateverelement] is not a function."
What I want to do is return specific values from a single layer of "Caption Layout" and apply them to a text layer in another comp, basically so that all I have to do is edit the text style once in "Caption Layout" and it'll propagate everywhere. Yes I could use this to just copy everything:
style = comp("Caption Layout").layer("ONE-Line Caption").text.sourceText.style
But that returns ALL values, whether I want them or not, and I need certain things different in the template so I can position things properly (specifically, everything in the template is ALL CAPS but I don't want the child layers to inherit that property).
These are the expressions I want to stack, exactly as I'm pasting them into the SourceText layer's expression editor:
style.setFontSize(style=comp("Caption Layout").layer("ONE-Line Caption").text.sourceText.style.fontSize);
style.setFauxBold(comp("Caption Layout").layer("ONE-Line Caption").text.sourceText.style.isFauxBold);
style.setAllCaps(style=comp("Caption Layout").layer("ONE-Line Caption").text.sourceText.style.isAllCaps);
style.setLeading(style=comp("Caption Layout").layer("ONE-Line Caption").text.sourceText.style.leading);
style.setTracking(style=comp("Caption Layout").layer("ONE-Line Caption").text.sourceText.style.tracking);
Each of these seems to work individually, but put them all together, even separated by a semicolon, and no matter which one is second, that's the one that kicks back an error. So in this case, it says "style.setFauxBold" is not a function, even though that line works perfectly by itself; if I delete that line, it'll do the same with AllCaps, and so on.
I know what I'm missing is probably absurdly simple, but I've been Googling for an hour and I can't figure it out. Help please???
