You would probably involve some string.replace() somewhere with a suitable regex inside the parenthesis to filter the characters, determine the word count and word boundaries or whatever. Similar could be done with an expression text animator set to per word mode. Apparently this could go as far as running everything in a complex loop and determining the sourceRectAtTime() on some dummy layers to figure out the actual dimensions of the rendered text. There is per se no elegant way of doing it, though, since you're basically trying to re-create the auto-scale paragraph text found in classic page layout programs, but don't have access to all the necessary parameters for the calculations due to AE's fixed evaluation and rendering order. That's why you have to construct nested loops and do it recursively, i.e. figure out the displayed text lengths first with a generous margin on the dummy layers, then in a second loop scale them down to fit within your criteria on the output layer where you re-assemble the individual lines. Mylenium
... View more