Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Is possible to combine style font and source text in expressions?

  • Is possible to combine style font and source text in expressions?

    Posted by Antonio Carba on April 1, 2021 at 3:34 pm

    Hello there!

    Simplified Scenario:

    I have a Text layer with “Hello” as source text and Georgia as font. This layer has a checkbox. When I click on it (true) I want to change the font style to Arial and the source text to “Bye”.

    Im using Javascript as Expression Engine.

    This is what I’ve tried, but nothing happend. It just takes one of the else statements, not both:
    ———————————————————————–

    var usertext = text.sourceText;

    var forcetext = “Bye”;

    if (effect(“Checkbox Control”)(“Checkbox”) == 0){

    usertext

    }

    else {

    style.setFont(“Arial-BoldMT”);

    forcetext;

    }
    ———————————————————————–

    Any thughts about this?

    Thanks in advance community!

    Fabrice Leconte replied 5 years, 5 months ago 2 Members · 1 Reply
  • 1 Reply
  • Fabrice Leconte

    April 1, 2021 at 6:31 pm

    You can use setText()

    style.setFont('Arial-BoldMT').setText(forcetext);

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