Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Text align script assistance

  • Text align script assistance

    Posted by Ruben Gomez on July 3, 2019 at 5:54 am

    Iam making a 5:00 countdown.. Everytime I have to manually adjust the text to hold the colon “:” in a Fixed position so that the text doesn’t keep wobbling left and right for every next digit. Can someone help me with a script that can hold “:” in Fixed position while counting down as well.

    I use this script for countdown that I found from creative cow

    rate = -1;
    clockStart = 300;
    delay = 2;

    function padZero(n){
    if (n < 10) return “0” + n else return “” + n
    }
    t = Math.max(time – delay,0);
    clockTime = Math.max(clockStart + rate*(t – inPoint),0);

    t = Math.floor(clockTime);
    min = Math.floor((t%3600)/60);
    sec = Math.floor(t%60);
    min + “:” + padZero(sec)

    Thanks

    Ruben Gomez replied 6 years, 10 months ago 2 Members · 2 Replies
  • 2 Replies
  • Tomas Bumbulevičius

    July 3, 2019 at 8:26 am

    Hey Ruben, is there a possibility for you to use a different font? It could be your life saviour, to change font into monospaced-type, where each character will keep the same width. As a result – no tedious movements ☺

    IF its not possible, then the second easiest option could be break down your result expression into two individual text layers, with ‘:’ layer in between. Set the minutes paragraph to be right sided, seconds – left sided.

    Find out more:
    After Effects Tutorials: motion design, expressions, scripting.
    Boxer – Dynamic Text Boxes Template with a Live Preview

  • Ruben Gomez

    July 3, 2019 at 9:18 am

    Thanks Thomas..
    I do a lot of countdowns… Sometimes I am lucky to use a monospace font.. Most of the time I had to use other types…
    I guess the second idea would work well for all types of fonts…

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