-
getstyleat() & setText() returns [object Object]
I’m trying to parent multiple text layers from multiple comps into 1 comp and keep their individual size and color. But what I tried and/ or found on several websites (including Adobe’s “Express yourself (and your text)”) doesn’t work.
Here’s one of the many that I tried:
TXT1 = comp("TXT1").layer("TXT1").text.sourceText
TXT2 =comp("TXT2").layer("TXT2").text.sourceText
a = TXT2.getStyleAt(0,0);
TXTcombined = a.setText(TXT2);
txt = TXTcombined + ' ' + TXT1;The result I get is:
[object Object] TXT1
with an unchanged text style.
I also tried using “var” or “const” for TXT2 and a -> Same result.
On the Adobe website it says:
style = thisComp.layer(“Parent”).text.sourceText.getStyleAt(0); style.setText(thisComp.layer(“Parent”).text.sourceText);
Same result.
I also tried to add the .style prefix like in Adobe’s example -> same result.
TXTcombined = TXT2.getStyleAt(0,0).setText(TXT2);
Same result.
There are some other help sites & videos, that state basically the same Expression over and over again and they all result in the same outcome for me. Only thing that’s different is, that they have their text layers in the same comp. But that shouldn’t be an issue?
So either I’m missing something or there has to be a new/ other way to get the text style + source text from another layer. I’m using AE 2020 and Javascript is enabled.
Has anyone experienced the same issue and/ or knows how to fix it?