One text line at a time every frame
I am looking for a script that display each line of text from a multi-line text in After Effects, every frame. To get the ideea, i want to export subtitles in a sequence file. Can anyone help me, please. Thanks!
I am looking for a script that display each line of text from a multi-line text in After Effects, every frame. To get the ideea, i want to export subtitles in a sequence file. Can anyone help me, please. Thanks!
If you set the Range Selector/Advanced/Mode to Subtract and subtract one from the Start value with this expression, you will get one line at a time. Apply this expression to End.
text.animator("Animator 1").selector("Range Selector 1").start -1
You can use the frame number of the Range Selector start and multiply that by the leading value in the text to offset the position of the text layer the height of a line on every frame. Unfortunately, different fonts have different heights so just copying the kerning value from the text layer, or dividing the height by the number of layers is not going to give you a perfect offset between frames. The easiest solution would be to add an expression control slider for Leading and add that into the expression for position. Something like this would work:
f = text.animator("Animator 1").selector("Range Selector 1").start;
l = effect("Leading")("Slider");
d = l * f;
[value[0], value[1] - d ]
I've included a project file.

That should do it. You'll just have to adjust the slider to make sure the text does not appear to move.
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.