Skip to main content
Known Participant
September 20, 2023
Answered

Expressions for text style parameters

  • September 20, 2023
  • 3 replies
  • 488 views

Usually I have little problems programming things with Expressions.
However, I can't get or set any of the "newer" accessible parameters like font size, tracking, leading, fill color, etc. etc.
This seems to take place with techniques that do not resemble normal After Effects expressions.
None of the examples that I can find on the entire internet work.

Something like

text.sourceText.style.setFontSize(25);

should work when pasted into the Source Text expression field, should it not?

 

This topic has been closed for replies.
Correct answer Christian Lengger

I tried your example and it works for me. Maybe your expressions engine is set to "Legacy ExtendScript" and not "JavaScript"?  (Project Settings/Expressions)

3 replies

Christian LenggerCorrect answer
Inspiring
September 20, 2023

I tried your example and it works for me. Maybe your expressions engine is set to "Legacy ExtendScript" and not "JavaScript"?  (Project Settings/Expressions)

Known Participant
September 20, 2023

Hell and the devil!
I know of this button of evil.

And it was this ugly setting indeed.
Thanks for saving my life. 

Mylenium
Legend
September 20, 2023

You may need to fetch the style before overriding it. The syntax is a bit more explicxit than for other expressiosn.

 

Mylenium

Known Participant
September 20, 2023

Especially the word "style" seems to provoke error messages.