ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

How to highlight one word in the text?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Vasyl Iskovych
How to highlight one word in the text?
on May 28, 2020 at 1:34:12 pm

Hello.
I have a text layer with lots of text.
I need to highlight in it, a specific word, in all places where it occurs.
Is it possible to do this not manually, but with an expression or script?
I would like to emphasize this word.
But perhaps you can change its color, or some other solution.
I hope for your help.
Thank.


Return to posts index

Andrei Popa
Re: How to highlight one word in the text?
on May 28, 2020 at 6:28:48 pm

Add a text animator.
On the selector, add expression selector.
Inside the expression of the expression selector write this. Modify the "asd" from row 1 with what word you want but do not remove anything else except "asd".


var regex = /.asd/g;
var t = text.sourceText;
var splitText = t.split("\r");


function indexMatched(index){
var matched = false;
var match;
while ((match = regex.exec(t)) !== null){
matched |= match.index<index & indexmaxIndex){
maxIndex += splitText[i].length;
i+=1;
}
return i-2;
}

indexMatched(textIndex+placeInLines(textIndex)) ? 100 : 0;


Andrei
My Envato portfolio.


Return to posts index

Vasyl Iskovych
Re: How to highlight one word in the text?
on Jun 1, 2020 at 4:59:27 pm

Thank you so much.
You helped me a lot.


Return to posts index

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