Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Repeat sourcetext from another layer

  • Repeat sourcetext from another layer

    Posted by Gray Wilcox on October 3, 2022 at 4:03 pm

    Hello! I’ve been trying to use this expression to repeat source text from another layer:

    My goal: to use the sourcetext from a main Build Comp and repeat it in X & Y using the following formula:

    the original:

    X = effect(“X”)(“Slider”);
    Y = effect(“Y”)(“Slider”);
    (repeat(X) + “\n”).repeat(Y)

    and here’s my attempt:

    my abomination:

    X = effect(“X”)(“Slider”);
    Y = effect(“Y”)(“Slider”);

    comp(“Build Comp”).layer(“ARTIST”).text.sourceText.repeat(X) + (“\n”).repeat(Y);

    I’d also like to add a space between the repeated words, if possible.

    Can anyone see where i’m going wrong? With my above abomination code, it will repeat in X but not Y.

    Gray Wilcox replied 3 years, 7 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    October 3, 2022 at 4:46 pm

    You just need to move a left paren in the last line, like this:

    (comp("Build Comp").layer("ARTIST").text.sourceText.repeat(X) + "\n").repeat(Y)
  • Gray Wilcox

    October 3, 2022 at 5:22 pm

    Thank you!!!

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