【问题标题】:Apply a graphic style应用图形样式
【发布时间】:2016-02-15 12:41:52
【问题描述】:

如何在 Adob​​e illustrator 中使用 ExtendScript 将图形样式(称为“line1”)应用到 PathItem

【问题讨论】:

    标签: javascript adobe-illustrator extendscript


    【解决方案1】:
    // 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] 来获取第一个数组。
    【解决方案2】:

    以下是Illustrator Scripting Guide 对应用图形样式的看法(第 17 页):

    您的脚本可以使用graphic style 对象将图形样式应用于图稿。要应用图形样式,请使用document 对象的graphic styles 属性来访问graphic style 对象的apply to 方法。

    请注意,给出的对象名称是针对 AppleScript 的。看起来在 ExtendScript 中使用的名称略有不同:graphic style 对象是 ArtStyle 对象。使用它的.applyTo() 方法。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多