Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Upper and Lower Text and maybe bold ???

  • Upper and Lower Text and maybe bold ???

    Posted by Alex Dinnin on November 2, 2020 at 2:21 pm

    HI there, I’m trying to set up an essential graphic so that the name typed in always conforms to Upper and Lower first word, the Upper second and third word. like this.

    Alex DINNIN (GBR) and if possible have the surname in Bold.

    Is this possible with expressions.. I was going to have a guide text layer where you type the name in. I’ve been playing about with this..

    n = “”;

    for (i=0; i< thisComp.layer(“Alex Dinnin (GBR)”).text.sourceText.split(” “).length; i++){

    n+=thisComp.layer(“Alex Dinnin (GBR)”).text.sourceText.split(” “)[i].charAt().toUpperCase() + thisComp.layer(“Alex Dinnin (GBR)”).text.sourceText.split(” “)[i].substring(1, thisComp.layer(“Alex Dinnin (GBR)”).text.sourceText.split(” “)[i].length).toLowerCase() + ” “

    }

    But I’m getting a bit lost.. any pointers would be greatly appreciated.

    Alex DINNIN (GBR)

    Alex Dinnin replied 5 years, 8 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    November 2, 2020 at 4:52 pm

    Something like this should handle the upper/lower case part (but not the bold):

    txt = thisComp.layer("Alex Dinnin (GBR)").text.sourceText.value;

    splt = txt.split(" ");

    str = splt[0][0].toUpperCase() + splt[0].substr(1).toLowerCase();

    str += txt.substr(splt[0].length).toUpperCase()

  • Alex Dinnin

    November 4, 2020 at 6:04 pm

    Thanks so much Dan !!!

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