【发布时间】:2016-02-15 12:41:52
【问题描述】:
如何在 Adobe illustrator 中使用 ExtendScript 将图形样式(称为“line1”)应用到 PathItem?
【问题讨论】:
标签: javascript adobe-illustrator extendscript
如何在 Adobe illustrator 中使用 ExtendScript 将图形样式(称为“line1”)应用到 PathItem?
【问题讨论】:
标签: javascript adobe-illustrator extendscript
// Get the style named "line1"
var style = app.activeDocument.graphicStyles.getByName("line1");
// Apply the style to your path item
style.applyTo(pathItem);
【讨论】:
app.activeDocument.graphicStyles 似乎是一个数组,例如,文档建议使用 app.activeDocument.graphicStyles[0] 来获取第一个数组。
以下是Illustrator Scripting Guide 对应用图形样式的看法(第 17 页):
您的脚本可以使用
graphic style对象将图形样式应用于图稿。要应用图形样式,请使用document对象的graphic styles属性来访问graphic style对象的apply to方法。
请注意,给出的对象名称是针对 AppleScript 的。看起来在 ExtendScript 中使用的名称略有不同:graphic style 对象是 ArtStyle 对象。使用它的.applyTo() 方法。
【讨论】: