Hey Julian, Thank you for your expression!
– The first one doesn’t work if I change the text from 3 lines to 2 lines. (Attached the images) Please lmk if I am wrong.
– The second one works great! If you have time, would you please explain the “const numLines thisComp.layer(“Text”).text.sourceText.split(‘\r’).length;” a little bit?
I only know that using “split(‘\r’)” can return the text to the next line. And “length” in text expression is the length of all characters. I have no idea when you combine them, you will get the number of lines. Wow!