Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Expressions Setting up an editable paragraph that will recognise the final line and word

  • Setting up an editable paragraph that will recognise the final line and word

  • Lauren Kinley

    January 24, 2022 at 10:35 pm

    Hi guys, I have spent all day on this and have very little knowledge of expressions or scripting so would appreciate any help!


    Iam setting up an editable chunk of text in AE that needs to be handed over to a client so they can change the source text to whatever they want.

    However the animation needs to recognise the lines individually, to each float up inside an alpha matte line by line, and needs to recognise the final line to type in slower per character, as well as the final word, in order to perform the same animation presets for whatever they want it to say.

    The final word also has a double layer to it, which I am sure I can figure out if everything else has been sorted.


    Currently my colleage helped with this code attached – that is for a simpler animation that just effects the last letter but is linked to source text and also uses the offset from the typewriter preset.


    Sorry if this is a jumble, and would very much appreciate any help! thank you





  • Lauren Kinley

    January 25, 2022 at 10:49 am


  • Filip Vandueren

    January 27, 2022 at 12:03 pm

    Hi Lauren, I’m not entirely sure what stuff needs to be animated and how (for example, floating inside an alpha matte ?).

    But hope this helps:

    Adding this expression on a textlayer, tells you how many visible lines that textlayer has wrapped to:

    ld = st.autoLeading ? st.fontSize*1.2 : st.leading;
    numLines = Math.round(h/ld);

    You can then maybe use that number in your textanimators based on lines.

  • Filip Vandueren

    January 27, 2022 at 12:09 pm

    And this expression gives you the number of words in your sourceText.

Viewing 1 - 4 of 4 posts

Log in to reply.

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