1
ベクトルシェイプの色を変更するコードに問題があります。ベクトル形状の色を変更する - フォトショップ
これは1つのレイヤーでのみ機能し、さらにレイヤーを選択するとエラーが発生します。誰もそれを修正する方法を知っていますか?
#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();