Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects 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 7:35 pm

    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.

    Walter Soyka replied 7 years, 10 months ago 3 Members · 3 Replies
  • 3 Replies
  • Clayton Glenn

    June 28, 2018 at 9:15 pm

    This may be better suited in After Effects Scripts forum… Apologies, I’m figuring out the forums here.

    Best wishes,

    Saving the world one pixel at a time.

  • Kalleheikki Kannisto

    June 29, 2018 at 5:26 am

    [Clayton Glenn] “and returns that it is expecting a ;”

    This seems to indicate you’re missing a “;” at the end of that line.

    Kalleheikki Kannisto
    Senior Graphic Designer

  • Walter Soyka

    June 29, 2018 at 9:38 am

    This works exactly as expected:

    s = "";
    for (i= 1;i <= 5;i++) s += thisComp.layer("EXAMPLE").text.sourceText;
    s

    If you’re still having trouble, please copy and paste the code you have that isn’t working.

    Walter Soyka
    Designer & Mad Scientist at Keen Live [link]
    Motion Graphics, Widescreen Events, Presentation Design, and Consulting
    @keenlive   |   RenderBreak [blog]   |   Profile [LinkedIn]

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