Okay, I got it working. I added this to the source text:
Speed = 40
StartAt = inPoint
X = text.sourceText;
T = time * Speed – StartAt * Speed;
if (T>0) X.substr(0,T)
And your script to the expression selector for the opacity animator:
spd = 40;
d = textTotal/spd;
t = time – (outPoint – d – thisComp.frameDuration);
i = t*spd;
textIndex-1 >= i ? 0 : 100
Is this the best way to do it? 🙂