Naitik Adani
Naitik Adani

Reputation: 236

Is there a way to change font color of a specific word in a string, in extendscript for after effects?

I can change the font color of the entire text layer successfully, but I cannot find a way to change the color of a specific word in a string.

For e.g. In this string "Trying to learn extendscript for after effects", I want to change the color of "learn" only.

var mySourceText = 
currItem.layers.byName('line04').property("ADBE 
Text Properties").property("ADBE Text Document");
var myTextDoc = mySourceText.value;
myTextDoc.fillColor = [0.5,0.5,0];
mySourceText.setValue(myTextDoc);

But this would change the color of the entire text layer.

Is there a possible solution to it? Thanks in advance.

Upvotes: 0

Views: 899

Answers (2)

zachnfine
zachnfine

Reputation: 1

It's possible –it's kind of a hack using text animators, but works.

Upvotes: 0

user5919840
user5919840

Reputation:

Nope! You can't set these properties for specific pieces of text in a text layer.

Upvotes: 3

Related Questions