giwilee03 发表于 2023-4-12 14:04:24

求助把选中图形颜色改成黑色,这脚本是整个文件图形填.....

doc = app.activeDocument;
newCMYKColor = new CMYKColor();
newCMYKColor.black = 100;
newCMYKColor.cyan = 0;
newCMYKColor.magenta = 0;
newCMYKColor.yellow = 0;
for (var i = 0; i < doc.pathItems.length; i += 1) {
    pathArt = doc.pathItems;
    if ((pathArt.fillColor.black + pathArt.fillColor.cyan +

pathArt.fillColor.magenta + pathArt.fillColor.yellow) > 0) {
      pathArt.fillColor = newCMYKColor;
    }
    if ((pathArt.strokeColor.black + pathArt.strokeColor.cyan +

pathArt.strokeColor.magenta + pathArt.strokeColor.yellow) > 0) {
      pathArt.strokeColor = newCMYKColor;
    }
}

g4222 发表于 2023-8-23 20:58:55

doc.pathItems改成doc.selection
页: [1]
查看完整版本: 求助把选中图形颜色改成黑色,这脚本是整个文件图形填.....