Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Source text

New Here ,
Feb 06, 2022 Feb 06, 2022

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

TOPICS
Expressions
246
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Feb 06, 2022 Feb 06, 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
  ""
  
Translate
Community Expert ,
Feb 06, 2022 Feb 06, 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?"

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 06, 2022 Feb 06, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 06, 2022 Feb 06, 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
  ""
  
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 06, 2022 Feb 06, 2022
LATEST

Worked like a charm!
Thanks a lot Dan. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines