Answered
Change shape operation on path
I'm trying to change the shape operation on a path via a script in Photoshop. Oddly though, using the relevant ScriptListener code results in error.
// SL code ERROR
// =======================================================
var idinvokeCommand = stringIDToTypeID( "invokeCommand" );
var desc3112 = new ActionDescriptor();
var idcommandID = stringIDToTypeID( "commandID" );
desc3112.putInteger( idcommandID, 3404 );
var idkcanDispatchWhileModal = stringIDToTypeID( "kcanDispatchWhileModal" );
desc3112.putBoolean( idkcanDispatchWhileModal, true );
executeAction( idinvokeCommand, desc3112, DialogModes.NO );
and my code below is error free, but ultimately doesn't work:
var srcDoc = app.activeDocument;
var pathitem = srcDoc.pathItems.getByName("My path");
pathitem.select();
// pathitem.operation = ShapeOperation.SHAPEADD;
var lineSubPathArray = new SubPathInfo();
lineSubPathArray.operation = ShapeOperation.SHAPEADD; // SHAPEADD SHAPESUBTRACT SHAPEXOR SHAPEINTERSECT
alert(lineSubPathArray.operation)
Not sure where I'm going wrong; unless the subpath operation needs to be done on each path point??
Any ideas.


