Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions AE expression – split text in 2 seperate equal text lines

  • Kalleheikki Kannisto

    August 3, 2018 at 6:48 am

    With three text boxes, the original one hidden, you can do it this way.

    Text layer “source text”: Your original text goes here

    Text layer “first text box” source text:
    text_array=thisComp.layer("source text").text.sourceText.split("\r");
    lines=text_array.length;
    mid=Math.round(lines/2);
    text_output = "";
    for(n=0; n

    Text layer "second text box" source text:
    text_array=thisComp.layer("source text").text.sourceText.split("\r");
    lines=text_array.length;
    mid=Math.round(lines/2);
    text_output = "";
    for(n=mid; n

    Kalleheikki Kannisto
    Senior Graphic Designer

  • Jonathan Moxness

    August 3, 2018 at 8:45 pm

    This is perfect! Thank you so much.

  • Paul Connors

    January 29, 2019 at 7:52 pm

    Howdy Dan. Thanks so much for this. It works like a charm! I’m trying to retrofit it to work for three lines instead of two. So, using the original text example of: “Once upon a time there was a princess” that would get split into 3 lines of “Once upon a” “time there was” “a princess”. Is that possible? If so, is it easy to update the expression to work for 3 lines, 4 lines, 5 lines, etc? Thank you!

  • Dan Ebberts

    January 29, 2019 at 8:03 pm

    I think it would get really messy really fast if you tried to set it up to divide the text into 3 or more lines of equal length. Not impossible, just tricky and tedious.

    Dan

  • Paul Connors

    January 29, 2019 at 10:06 pm

    That makes sense. Well, the two lines works amazing! Thank you very much! 🙂

Page 2 of 2

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy