ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Copy Text Using Expressions

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Niels Otto
Copy Text Using Expressions
on Jan 14, 2020 at 11:33:55 am

Hi
I'm trying to copy the source text of one layer, and making it into a wall of that name as a background element. I want to use expression to copy the text, to make it dynamic.

I put the following code in as an expression on the source text of a "copy" layer, trying to copy the "Name" layer using a for loop:
name = thisComp.layer("Name").text.sourceText
for(i = 0; i < 5; i++) {
name = name + "\r" + name
}


Which gives me this:


My goal is this:


Any help is appreciated

Thanks

name = thisComp.layer("Name").text.sourceText
for(i = 0; i &lt; 5; i++) {
name = name + "\r" + name
}


Return to posts index

Andrei Popa
Re: Copy Text Using Expressions
on Jan 14, 2020 at 1:29:53 pm

I don't know of a better way than this. First is columns and second is rows

(repeat(4)+"\n").repeat(3)

Andrei
My Envato portfolio.


Return to posts index

Niels Otto
Re: Copy Text Using Expressions
on Jan 14, 2020 at 3:18:05 pm

This worked perfectly. Thank you!

I ended up doing
name = thisComp.layer("Name").text.sourceText + " ";
(name.repeat(150)+"\n").repeat(60);


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2020 CreativeCOW.net All Rights Reserved
[TOP]