我可以更改文本颜色,但格式也在更改!我的文字有一半是粗体,另一半是斜体。但最后所有的文字都变成了粗体。
var proj = app.project;
var theComposition = app.project.activeItem;
var theTextLayer = theComposition.layers[1];
var textProp1 = theTextLayer.property("Text").property("Source Text");
var textProp2 = theTextLayer.property("Source Text").value;
textProp2.fillColor = [1,1,1];
textProp1.setValue(textProp2);
当您设置TextDocument
: 时,textProp1.setValue(textProp2);
它会设置所有TextDocument
属性。Adobe 不通过 Extendscript 支持每个文本层的多种格式(例如:fillColor、fontSize、fontFamily 等),因此该层获取第一个字母的属性,在您的情况下为 Bold。
我可以建议您向图层添加填充效果并更改效果中的值。这是一个代码:
var fillEffect = theTextLayer.property('ADBE Effect Parade').addProperty('ADBE Fill');
fillEffect.property('Color').setValue([1,1,1]);
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句