Skip to main content
dbDavideBoscolo
Legend
Aug 23, 2022 12:22 AM UTC
Answered

Change text color by scripting

Hi all,

 

I am using this code to change the color of a text layer. 

 

var mySourceText = layer.property("Source Text");
var textDocument = mySourceText.value;
  
textDocument.fillColor = RGBcolor;
textDocument.strokeColor = RGBcolor;
  
mySourceText.setValue(textDocument);

 

It works fine if the text has the same style. 

If not uniform, it changes the text style to match the first character style.
For example, if I want to change this text to green:


This is what I'd like to get:

However, this is what I get:

Any ideas?

This topic is closed to new replies. Start a new post to keep the conversation going.
Douglas_WaterfallCorrect answer
Adobe Employee
Nov 21, 2023 4:50 AM UTC

We have what you want now available in Beta.

 

https://community.adobe.com/t5/after-effects-beta-discussions/per-character-scripting-public-beta-announcement/td-p/14247138

 

Douglas Waterfall

After Effects Engineering

8 replies

Douglas_WaterfallCorrect answer
Adobe Employee
Nov 21, 2023 4:50 AM UTC

We have what you want now available in Beta.

 

https://community.adobe.com/t5/after-effects-beta-discussions/per-character-scripting-public-beta-announcement/td-p/14247138

 

Douglas Waterfall

After Effects Engineering

Translate
dbDavideBoscolo
Legend
Nov 21, 2023 4:51 AM UTC

I've just seen it on X! Great update thank you! 

Translate
Mathias Moehl
Community Expert
Community Expert
Aug 23, 2022 7:00 AM UTC
Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
dbDavideBoscolo
Legend
Aug 31, 2023 11:08 PM UTC

Where has this gone now?

Translate
Mathias Moehl
Community Expert
Community Expert
Sep 1, 2023 8:58 AM UTC

I think there is no such public place to vote for feature requests anymore...

 

Translate
Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
Dan Ebberts
Community Expert
Community Expert
Aug 23, 2022 1:02 AM UTC

Unfortunately, that's how it works. If your script modifies the text document, everything gets the styling of the first character. You have to use multiple text layers.

Translate
dbDavideBoscolo
Legend
Aug 23, 2022 1:11 AM UTC

Oh!, ok thank you Dan. I'll cope with that.

Cheers!

Translate