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

Trouble with using CSV for SourceText AND using style.setFontSize together

Community Beginner ,
Jun 23, 2025 Jun 23, 2025

I have a lot of text layers. I have two expressions working but they're not working together.

 

col = 0;

row = index - 1;

sl = thisComp.layer("CNTRL").effect("Text Size")("Slider");

txt = footage("Use Cases.csv").dataValue([col, row]);

text.sourceText.style.setFontSize(sl);

 

So, if this expression ends with the "style.setFontSize" command, then it ignores the text that it pulls from the CSV and defaults to the set sourcetext. But if it ends with "txt" then it pulls in the proper text from the CSV, but I have no control over the Font Size.

 

How can I get these two commands working together?

 

I've tried all sorts of rearranging. ChatGPT suggested this:

 

USC = text.sourceText instanceof TextDocument ? text.sourceText : new TextDocument("");

USC.text = txt;

USC = style.setFontSize(sl);

USC

 

but I don't know what it's referencing thinking that this is viable. The "instanceof" and "new" commands aren't something I've ever been aware of and they're definitely not working.

TOPICS
Expressions
154
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 , Jun 23, 2025 Jun 23, 2025

Try it this way:

col = 0;
row = index - 1;
sl = thisComp.layer("CNTRL").effect("Text Size")("Slider");
txt = footage("Use Cases.csv").dataValue([col, row]);
style.setFontSize(sl).setText(txt);
Translate
Community Expert ,
Jun 23, 2025 Jun 23, 2025

Try it this way:

col = 0;
row = index - 1;
sl = thisComp.layer("CNTRL").effect("Text Size")("Slider");
txt = footage("Use Cases.csv").dataValue([col, row]);
style.setFontSize(sl).setText(txt);
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 Beginner ,
Jun 23, 2025 Jun 23, 2025

That did it! You're the best! So with the "style.set......" expressions, are you able to just build a long string of those together in no particular order, or is the sequence critical to it?

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 ,
Jun 23, 2025 Jun 23, 2025

Yes, you can string them together and I think the order isn't important, but I'm not 100% ceratin of that. If there are any rules as to the order, I'd love to know what they are...

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
Valorous Hero ,
Jun 23, 2025 Jun 23, 2025
LATEST

Hi Dan, I believe setJustification has to be last if it is invoked. This was from the AeTeam sometime last year - I've not heard of an update on this since.

Very Advanced After Effects Training | Adaptive & Responsive Toolkits | Intelligent Design Assets (IDAs) | MoGraph Design System DEV
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