Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity › Forums › Adobe After Effects Expressions › Change only the color of UPPERCASE WORDS using an expression in Adobe After Effects

  • Change only the color of UPPERCASE WORDS using an expression in Adobe After Effects

    Posted by Ian Rojas godoy on November 1, 2018 at 6:25 pm

    Hi, Creatives! I have a challenge for you.

    I have been trying to solve this puzzle for the last couple of hours; maybe you can answer it!

    In Adobe After Effects, I would like to change only the color of uppercase words in a sentence to a specific color using an expression.

    Long story short, I am creating an Adobe Premiere template in After Effects using the “Essential Graphics ” window. The Essential Graphics editor in Adobe Premiere won’t allow the user to change more than one color in the “source text box.” I need for every uppercase word to change to a specific color. I am assuming one can get around this issue by automating this action with an expression in After Effects.

    Thank you in advance for any help or advice you can provide! ????

    – Ian

    Kalleheikki Kannisto replied 7 years, 11 months ago 2 Members · 1 Reply
  • 1 Reply
  • Kalleheikki Kannisto

    November 2, 2018 at 3:18 pm

    On the concept level, my first inclination would be to do this:

    1) Separate the source text to individual words array by splitting at space character
    2) Loop through each letter in each word and give each word a “isUpperCase” (variable) boolean value of true only if there are zero lower case alphabets there
    3) Add a color expression to the text
    4) With an expression selector, set the value of those characters that are in the “isUpperCase” words to 100%

    The question is how do you do #4? Perhaps by creating at step 2 a string that has the exact number of zeros and ones corresponding to each letter of text and spaces and then at step 4 set the selector value to 100 if the characterAt is “1” or to 0 if the characterAt is “0”. So for the sentence “My sentence WITH some upperCASE.” You would get the matching string of “00000000000011110000000000000000”. Note that the word “upperCASE” would have the values “0” since it is a mix.

    Better methods are bound to exist.

    Kalleheikki Kannisto
    Senior Graphic Designer

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