Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Text Style expressions not working?

  • Text Style expressions not working?

    Posted by Royce Jacobs on August 14, 2021 at 3:33 am

    Hey guys, so it was my understanding that in newer versions of Ae there’s now a TextStyle class? My Ae is up to date (v18.4.0) but every time I try to use any expressions I’ve found with these styling options I get errors. The following expression placed on the Source Text of a text layer gives me an error saying that ‘style’ in Class ‘TextProperty’ is missing or does not exist.

    text.sourceText.style.setFontSize(25).setText("This is text")

    What I’m ultimately wanting to do is have different font sizes on different strings on the same text layer, just as you could do manually typing the text out, but thru expressions.

    What am I doing wrong here?

    Royce Jacobs replied 5 years ago 2 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    August 14, 2021 at 3:43 am

    My guess is that you have File > Project Settings > Expressions set to Legacy Extendscript. But in any case, you won’t be able to set more than one Font for a single text layer.

  • Royce Jacobs

    August 14, 2021 at 5:09 am

    You’re a legend Dan, thanks so much!! I knew something was awry…
    As far as having multiple styles, what approach would you recommend? Once I call more than just one variable it gets angry about objects, which is doesn’t do if the variables are only strings..

    first = text.sourceText.style.setFontSize(25).setText("This is text");
    second = text.sourceText.style.setFontSize(72).setText("This is bigger text");
    first+'\r'+second
  • Dan Ebberts

    August 14, 2021 at 10:04 am

    Unfortunately, with the current implementation, there’s no way you can use an expression to generate different styles for different characters within the same text layer. All characters end up with the same styling as the first character.

  • Royce Jacobs

    August 14, 2021 at 10:10 am

    Okay, thanks for the clarification! 😉

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy