Copy link to clipboard
Copied
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.
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);
Copy link to clipboard
Copied
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);
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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...
Copy link to clipboard
Copied
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.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now