Skip to main content
Participant
February 6, 2022
Answered

Source text

  • February 6, 2022
  • 1 reply
  • 436 views

Is there an expression that links Source text from a specific row from another text layer?

This topic has been closed for replies.
Correct answer Dan Ebberts

This should give you whichever line you set "n" to:

txt = thisComp.layer("Text Layer").text.sourceText.split("\r");
n = 3; // get 3rd line
if (txt.length >= n)
  txt[n-1]
else
  ""
  

1 reply

Community Expert
February 6, 2022

I am not sure what you are asking. You can easily repeat the text in any text layer using a simple pickwhip expression. What exactly are you trying to accomplish? What do you mean when you say "another row?"

Participant
February 6, 2022

Hi Rick
Thanks a lot for replying,
I have a text layer that consistes of about 30 lines, each line is a diffreant word.
I need to connect a new text layer to a specific line in the "master" text layer.
Let's say the master layer is:
"Retail store

Architect

Real estate"

I want to connect the source text of a new layer to just one of the lines
that way any new layer with this expression will update from the master text layer to a specific line.
so the end result will give me 3 difreant text layers for Retail store ,Architect, Real estate

Thanks

Dan Ebberts
Community Expert
Dan EbbertsCommunity ExpertCorrect answer
Community Expert
February 6, 2022

This should give you whichever line you set "n" to:

txt = thisComp.layer("Text Layer").text.sourceText.split("\r");
n = 3; // get 3rd line
if (txt.length >= n)
  txt[n-1]
else
  ""