Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions An expression to colour specific words in text

  • An expression to colour specific words in text

    Posted by Daniel Casey on June 12, 2019 at 3:28 pm

    Hey All,

    Is there an expression to colour all words that begin with an @symbol in a block of text?

    I’m making something to show tweets and want to highlight all @’s in the twitter blue colour. There’s a possibility the text will have multiple words starting with @ but will always been one word.

    Is there any way to do this?

    Thanks
    Dan

    Alborz Riazi replied 4 years, 11 months ago 4 Members · 5 Replies
  • 5 Replies
  • Miguel De mendoza

    June 12, 2019 at 6:14 pm

    You can not change the color of specific characters in a text layer.

  • Kalleheikki Kannisto

    June 13, 2019 at 7:08 am

    Add Fill color animator with twitter blue and an expression selector (based on words) to the text. Then use this expression:

    words = text.sourceText.split(" ");
    currentWord = words[textIndex-1];
    if(currentWord.charAt(0)=="@"){color=100}else{color = 0};
    [color,color,color]

    Kalleheikki Kannisto
    Senior Graphic Designer

  • Daniel Casey

    June 13, 2019 at 8:49 am

    Hi Kalleheikki,

    Thanks, this has been a huge help.

    Is there a way to modify this so that it can colour multiple words that start with @ in the same block of text?

    Thanks
    Dan

  • Daniel Casey

    June 13, 2019 at 10:19 am

    Ignore the previous Email, multiple words do work.

  • Alborz Riazi

    May 29, 2021 at 12:50 am

    Nearly two years after you posted this, it helped me loads. Thanks a million for the great expression.

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