Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Repeating Text with Text Sourced from Another Layer

  • Repeating Text with Text Sourced from Another Layer

    Posted by Clayton Glenn on June 28, 2018 at 9:17 pm

    Apologies, I think that this is best posted here rather than the AE forum.

    Trying to get this to work, getting a text sourced from another layer to repeat a given number of times. In this case 5.

    Beginnings work
    s = “”;
    for (i= 1;i <= 5;i++) s +=”source from other layer”;
    s

    For a layer named layer name I am trying to get it to replacy the “source from other layer”;

    Using a pickwhip from the chosen layer, EXAMPLE with live type,
    thisComp.layer(“EXAMPLE”).text.sourceText

    It doesn’t seem to see it as a source and returns that it is expecting a ;

    Any ideas? Many thanks for the time.

    s = "";
    for (i= 1;i &lt;= 5;i++) s +="source from other layer";
    s

    thisComp.layer("EXAMPLE").text.sourceText

    Saving the world one pixel at a time.

    Clayton Glenn replied 7 years, 10 months ago 1 Member · 1 Reply
  • 1 Reply
  • Clayton Glenn

    June 28, 2018 at 9:38 pm

    I bugged everyone I could and found a solution. It was a simple mistake.
    In a layer with type saying “IT WORKS” is the source for the repeating text
    and it looks like this…

    I added extra spaces after the selected text to provide even spacing.

    It was a misuse of quotation marks that made the previous effort not work.

    Best wishes to all.

    s = "";
    for (i= 1;i &lt;= 10;i++) s +=thisComp.layer("IT WORKS").text.sourceText + " ";
    s

    Saving the world one pixel at a time.

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