Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Working with multi-line text box

  • Working with multi-line text box

    Posted by Dennis Cheung on September 16, 2022 at 2:09 am

    Hello

    I have a text box with two of lines of text, let’s call it A.

    I want to assign the sourceText of line 1 in (A) to a text layer (B), and assign the sourceText of line 2 to another text layer (C).

    How do I grab the content before the “\r” and send it to text layer (B), and the content after the “\r” and send it to text layer (C)?

    Thank you for your time.

    Dan Ebberts replied 3 years, 8 months ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    September 16, 2022 at 3:48 am

    Like this for B:

    thisComp.layer("A").text.sourceText.split("\r")[0]

    and this for C:

    thisComp.layer("A").text.sourceText.split("\r")[1]

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