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

天涯浪子 提交于 2019-12-13 03:12:15

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/48749423/is-there-a-way-to-change-font-color-of-a-specific-word-in-a-string-in-extendscr

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!