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 just don’t work

  • Text style expressions just don’t work

    Posted by Paul Roper on September 20, 2023 at 4:18 pm

    I must admit, I’ve never actually used any of the text style expressions, but today I’d like to. So I looked at the Adobe help, and it suggested this expression would return the font name of another layer:

    var otherLayer = thisComp.layer("Some Text"); 
    otherLayer.text.sourceText.style.font;

    I’ve set this up in a comp, with just 2 layers; on “Layer 1” I’ve pasted that expression into its Source Text (so I can see the font name), but I just get this error:

    After Effects warning: Expression disabled. Error at line 2 in property ‘Source Text’ of layer 1 (‘Layer 1’) in comp ‘Test’. 
    property or method named ‘style’ in Class ‘TextProperty’ is missing or does not exist. It may have been renamed, moved, deleted, or the name may have been mistyped

    Any idea why? I’ve tried a few of those font/style etc. expressions from Adobe’s help page, and none of them work.

    Paul Roper replied 2 years, 7 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    September 20, 2023 at 6:07 pm

    Most likely you have File > Project Settings > Expressions set to the Legacy ExtendScript engine. The other possibility is that you’re using an older version of AE.

  • Paul Roper

    September 21, 2023 at 8:35 am

    Oh yes! Checking the scripting system was also one of my first thoughts, and I thought I’d checked that – I looked in the prefs and couldn’t even find the option to change it (I’m sure it used to be in there, didn’t it?) and because the option wasn’t even in there, I assumed that Adobe must’ve dropped the old ExtendScript system completely, and JavaScript was the only option these days. As you suggested, it’s in the Project Settings (has it always been there?) and indeed, for some reason, it was set to Legacy ExtendScript! I think that must’ve happened during a recent AE update – I’ve always used JavaScript expressions since it became an option years ago. (I’m on AE 2023 and AE Beta – I like using the beta version, but often switch back to the release version when AE misbehaves…but inevitably the same problems are there in the release version – like non-playback, non-refreshing of the comp viewer…but those are another, old, issue!).

    And now those text expressions work perfectly. Thanks, Dan!

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