Hi Dan or anyone else that can help,
I tried this expression in my own project and it works pretty well.. I modified it to create a line break after the 10th character. Only problem is it disables right when it hits character 10. At 9 it’s fine, at 11 it’s fine, but at 10 in doesn’t seem to know what to do.
Doing my best to figure it out but unfortunately I’m relatively new to this and my debugging abilities are limited. Hopefully it’s a simple fix. Any help would be greatly appreciated!
Olga
txt = comp("EDIT_THIS_COMP").layer("Text").text.sourceText;
if (comp("EDIT_THIS_COMP").layer("Text").text.sourceText.length >= 10){
for (i = 10; i > 0; i--) if (txt[i] == " ") break;
if (i > 0)
txt.substr(0,i) + "\r" + txt.substr(i+1)
else
txt.substring(0,10) + "\r" + txt.substring(11,999);
}else{
txt
}