Code: Select all
a = ["Title1", "Title2", "Title3 is a bit longer\r\nso it needs to wrap around"];
n = Math.floor(thisComp.layer("Controller").effect("TextNo")("Slider"));
a[n]
Code: Select all
v = thisComp.layer("TitleText").text.sourceText.indexOf("\r\n");
EDIT: ...sourceText.indexOf("longer") seems to work for those examples (-1 for n=0 or n=1, 16 for n=2), so it's something to do with the \r\n part. I've tried enclosing that bit in single quotes - ' - and escaping the backslashes with another backslash, but that doesn't work...
Cheers
Nick