Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Changing the font style with Dropdown Menu Control

  • Dan Ebberts

    June 17, 2023 at 6:03 pm

    You can do it, but your expression has to contain the actual font names (which may not match exactly the names in your dropdown). So the expression might look like this for “Arial”, “Bookman Old Style”, and “Lucida Console”, for example:

    m = effect("LANGUAGE")("Menu").value;
    switch(m){
    case 1:
    font = "ArialMT";
    break;
    case 2:
    font = "BookmanOldStyle";
    break;
    case 3:
    font = "LucidaConsole";
    break;
    default:
    font = "ArialMT";
    break;
    }
    style.setFont(font)
  • Dmitriy Khomyakov

    June 17, 2023 at 6:22 pm

    unfortunately does not work. Maybe you know what the problem is?

  • Dmitriy Khomyakov

    June 17, 2023 at 6:26 pm
  • Dan Ebberts

    June 17, 2023 at 6:28 pm

    Sorry, I missed the fact that you had the menu control on a separate layer. Try changing the first line to this:

    m = thisComp.layer("CTRL").effect("LANGUAGE")("Menu");
  • Dmitriy Khomyakov

    June 17, 2023 at 6:34 pm

    Again an error. Can you please correct me in the AE file (attached)

  • Dmitriy Khomyakov

    June 17, 2023 at 6:35 pm
  • Dan Ebberts

    June 17, 2023 at 6:40 pm

    You have the expression engine set to Legacy Extendscrpt.

    set File > Project Settings > Expressions > Expressions Engine to JavaScript.

  • Dmitriy Khomyakov

    June 17, 2023 at 6:58 pm

    It doesn’t work for me :((

    I need Expression because everything else in the project is built on Expression

  • Dan Ebberts

    June 17, 2023 at 7:26 pm

    Are you saying that you have expressions in your project that require the Legacy ExtendScript expression engine? If so, are there too many to just fix the expressions?

  • Dmitriy Khomyakov

    June 17, 2023 at 7:45 pm

    I will punch.

    And your expression in Java works, I switched it and it all worked. Thank you!

Page 1 of 2

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