Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Change text color by scripting

Engaged ,
Aug 22, 2022 Aug 22, 2022

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:

Screenshot 2022-08-23 081837.pngexpand image
This is what I'd like to get:
Screenshot 2022-08-23 082050.pngexpand image
However, this is what I get:
Screenshot 2022-08-23 081956.pngexpand image
Any ideas?

TOPICS
Scripting
1.6K
Translate
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

correct answers 2 Correct answers

Community Expert , Aug 22, 2022 Aug 22, 2022

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
Adobe Employee , Nov 20, 2023 Nov 20, 2023

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
Community Expert ,
Aug 22, 2022 Aug 22, 2022

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
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
Engaged ,
Aug 22, 2022 Aug 22, 2022

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

Cheers!

Translate
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 Expert ,
Aug 23, 2022 Aug 23, 2022

Please vote for this feature request, if you want Adobe to improve this: https://adobe-video.uservoice.com/forums/911311-after-effects/suggestions/37888861-scripting-access-...

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
Translate
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
Engaged ,
Aug 31, 2023 Aug 31, 2023

Where has this gone now?

Translate
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 Expert ,
Sep 01, 2023 Sep 01, 2023

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

 

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
Translate
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
Engaged ,
Sep 04, 2023 Sep 04, 2023
Translate
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 Employee ,
Nov 20, 2023 Nov 20, 2023

We have what you want now available in Beta.

 

https://community.adobe.com/t5/after-effects-beta-discussions/per-character-scripting-public-beta-an...

 

Douglas Waterfall

After Effects Engineering

Translate
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
Engaged ,
Nov 20, 2023 Nov 20, 2023
LATEST

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

Translate
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