Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


How do I change the color of two words in my source text.

Community Beginner ,
Jul 27, 2021 Jul 27, 2021

Copy link to clipboard

Copied

Hey there,

 

I have a great little expression that generates a sentenance. 

compName = thisComp.name;
textBefore = "The amount totals to ";
textAfter = ".";
textBefore+compName.substring(0, compName.indexOf("-"))+textAfter;

The amount totals to five.

How do I change the color of the compName and textAfter values?


TOPICS
Expressions

Views

30

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jul 27, 2021 Jul 27, 2021

Copy link to clipboard

Copied

You don't. These are not scriptable with source text expressions. You will have to apply a text animator for Fill color, which in fact per your example would be the simplest solution, anyway, by setting it to per word and adjusting the range settings to always cover that last word. More complex string manipulation may of course require a different approach involving an expression selector or soem such thing, but give this a whirl as a start.

 

Mylenium

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 27, 2021 Jul 27, 2021

Copy link to clipboard

Copied

LATEST

Thanks Mylenium,

 

Yes added range selector in the animator and it got me out trouble. Thank you for responding so quickly 🙂

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines