ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

An expression to colour specific words in text

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Daniel Casey
An expression to colour specific words in text
on Jun 12, 2019 at 3:28:19 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


Return to posts index

Miguel de Mendoza
Re: An expression to colour specific words in text
on Jun 12, 2019 at 6:14:53 pm

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


Return to posts index

Kalleheikki Kannisto
Re: An expression to colour specific words in text
on Jun 13, 2019 at 7:08:50 am
Last Edited By Kalleheikki Kannisto on Jun 13, 2019 at 7:09:42 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


Return to posts index


Daniel Casey
Re: An expression to colour specific words in text
on Jun 13, 2019 at 8:49:57 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


Return to posts index

Daniel Casey
Re: An expression to colour specific words in text
on Jun 13, 2019 at 10:19:57 am

Ignore the previous Email, multiple words do work.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]