Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Compine two text change scrips – setFont and toLowerCase

  • Compine two text change scrips – setFont and toLowerCase

    Posted by Zander Grinfeld on November 7, 2024 at 2:29 pm

    I am using an expression to give control of a font with a slider, But I want to add similar control over whether the text (a single letter on it’s own layer) is uppercase or lowwercase. I’m failing at the first hurdle. When I add a toLowerCase (before trying to connect a slider) it just overrides the font changer. It’s pretty basic chaining expressions I reckon, but could do with a hand! Thanks

    var fontArray=[

    “Impact”,

    “AbrilFatface-Regular”,

    “KufiStandardGK”,

    ];

    v=Math.round(effect(“Slider Control”)(“Slider”));

    text.sourceText.style.setFont(fontArray[v]);

    — above this line works until I add below this line ————-

    text.sourceText.toLowerCase();

    Dan Ebberts replied 1 year, 8 months ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    November 7, 2024 at 4:46 pm

    Try it this way:

    var fontArray=[
    "Impact",
    "AbrilFatface-Regular",
    "KufiStandardGK",
    ];
    txt = text.sourceText.toLowerCase();
    v=Math.round(effect("Slider Control")("Slider"));
    text.sourceText.style.setFont(fontArray[v]).setText(txt)

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