【发布时间】:2016-10-19 19:38:22
【问题描述】:
我的代码有问题,它会改变矢量形状的颜色。
它仅适用于一层,如果您选择更多层,它会弹出错误。有人知道怎么解决吗?
#target photoshop
cTID = function(s) { return app.charIDToTypeID(s); };
sTID = function(s) { return app.stringIDToTypeID(s); };
function Action3() {
function step1(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putEnumerated(sTID("contentLayer"), cTID('Ordn'), cTID('Trgt'));
desc1.putReference(cTID('null'), ref1);
var desc2 = new ActionDescriptor();
var desc3 = new ActionDescriptor();
var desc4 = new ActionDescriptor();
desc4.putDouble(cTID('Rd '), 243);
desc4.putDouble(cTID('Grn '), 110);
desc4.putDouble(cTID('Bl '), 93);
desc3.putObject(cTID('Clr '), sTID("RGBColor"), desc4);
desc2.putObject(cTID('FlCn'), sTID("solidColorLayer"), desc3);
var desc5 = new ActionDescriptor();
desc5.putInteger(sTID("strokeStyleVersion"), 2);
desc5.putBoolean(sTID("fillEnabled"), true);
desc2.putObject(sTID("strokeStyle"), sTID("strokeStyle"), desc5);
desc1.putObject(cTID('T '), sTID("shapeStyle"), desc2);
executeAction(cTID('setd'), desc1, dialogMode);
};
step1(); // Set
};
Action3.main = function () { Action3();};Action3.main();
【问题讨论】:
标签: javascript photoshop jsx