-
Alternating text styles in a sourceText property
Hey people,
I was wondering if any of you knew whether it’s possible to have alternating text styles in the new AE sourceText expressions. Seems kinda impossible from what I can gather from the syntax, but do you guys know anything about that?
Here’s some sample code to explain what I’m trying to do.
// get sourceText styles from two layers
const headlineStyle = thisComp.layer("Headline Style").text.sourceText.getStyleAt(0,0);
const sublineStyle = thisComp.layer("Subline Style").text.sourceText.getStyleAt(0,0);
// get sourceText value from another layer
let v = thisComp.layer("Sample Text").text.sourceText;
// split by newline
v = v.split("\n");
// assign different text styles to resulting array
// here comes some wishful thinking syntax, I know that's not how any of this works
v[0].applyStyle(LHeadlineStyle)
v[1].applyStyle(LSublineStyle)Thanks in advance, love this forum!