Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Expressions Parenting multiple source text layers, omitting specific formatting

  • Parenting multiple source text layers, omitting specific formatting

  • Antony Dupsta

    August 18, 2022 at 2:12 am


    I am hoping someone can help me with a source text property expression.

    And thanks for reading this and your help is much appreciated.

    I have a scenario where I am wanting to have two separate text layers link to each other. However there is a catch…

    So currently I have the text layer in comp B linked to the master Text layer in comp A. I simply write in the data once in comp A and it ripples out.

    However, the master Text layer in comp A, I have do you say.. indent, space down, return, auto carriage, whatever we call it nowadays, I can’t find the word. I digress…

    So the Master text layer in comp A needs to fit into a fixed boundary, I hit return to drop the text down to the next line.

    The issue I am having is that the child text in comp B, this text layer is located on the bottom of frame, it needs to be one long string and can not return down, as it then is out of the picture, below frame, not readable. But when I hit return in comp A the text in Comp B also indents down out of frame.

    So my mind was go about this two ways. But I am struggling here and I am not strong with expressions.

    1) Comp A ,”master text,” possibly has an expression so that it will auto drop down if the string of text is too long, but I don’t physically hit return. You just type as much as you want and it indents based on a value, like if it goes over 200 characters it auto indents, but not in the middle of a word. Oh I am thinking this may get tricky?

    The hope is that child text in comp B just reads it as one long string of text. Does not see any formatting that drops it down as that is being done as an expression? So the text in comp B just fits along the bottom of the frame as it read the master string of text.

    2) Or, possibly I can add an expression to the end of the child Text layer in comp B that removes formatting from the parent it is linked to, removes indentions? So it reads the master Text layer for source text, but does not carry over the indention, child text in comp B is now one line of text that is strung out on the bottom of frame. It can have the spacing just no indentions?

    Does this seem possible and did I explain this OK?



  • Dan Ebberts

    August 18, 2022 at 6:19 am

    Something like this for Comp B should get the text from Comp A, but replace the line breaks with spaces:

    txt = comp("Comp A").layer("Master Text").text.sourceText;
    txt.split("\r").join(" ")
  • Antony Dupsta

    August 18, 2022 at 5:33 pm

    That worked perfect. Thanks for helping me with this expression. Much appreciated.

Viewing 1 - 3 of 3 posts

Log in to reply.

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