Copy link to clipboard
Copied
There is a text layer#1 with 6 text lines. It is necessary that 1st, 2nd and 3d text line from layer#1 be displayed on a text layer#2, and 4th, 5th and 6th text line be displayedon a text layer#3 .And generally speaking, text layer#1 shoud be precomposed.
thanx)
Copy link to clipboard
Copied
when you say 6 text lines, you mean there is a return between each line of text in that layer ? and you want the first lines to appear as 1 line in a different text layer, and then the next 3 to appear on the a different layer. and what hppens if there is 7 lines of text ?
Copy link to clipboard
Copied
for example this would combine all 6 onto one layer ( now we need to figure out how to stop at 3, etc.... )
thisComp.layer("text 1").text.sourceText.replace(/\r/g, " ");
Copy link to clipboard
Copied
this is for the first 3
a=thisComp.layer("text 1").text.sourceText.split('\r')[0];
b=thisComp.layer("text 1").text.sourceText.split('\r')[1];
c=thisComp.layer("text 1").text.sourceText.split('\r')[2];
a+" "+b+" "+c
Copy link to clipboard
Copied
and
d=thisComp.layer("text 1").text.sourceText.split('\r')[4];
e=thisComp.layer("text 1").text.sourceText.split('\r')[5];
f=thisComp.layer("text 1").text.sourceText.split('\r')[6];
d+" "+e+" "+f
Copy link to clipboard
Copied
if the text layer is precomposed just replace
thisComp.layer("text 1")
with
comp("precomp").layer("text 1")