-
If Else When Source Text Contains String
I am building a .mogrt with a paragraph that is all caps and has very tight line spacing. It works great until a user types the letter “Q”, then the descender overlaps the line beneath it. No problem I think to myself, I will just create an if/else that recognizes when the source text contains a “Q” and increase the line spacing. How hard could that be? Two hours later I am stumped.
I added a Line Spacing animator to the text layer, searched the internet, and learned that there was such a thing as Regular Expressions, broke my brain trying to quickly understand them, and hoped something like this would work. Obviously, it did not.
var txt = text.sourceText;
var findQ = txt.test(“q”);
if(findQ == true) {[value[0], 20]} else {[value[0], 0]}
I am hoping one of you can see through my mistake and offer up an answer cause my brain hurts.
Thanks in advance.