Copy link to clipboard
Copied
Hi,
Shape layers and Adjustement Layer "Color fill" shares the same LayerKind. How can I difference them?
ShapeLayerObject.kind == LayerKind.SOLIDFILL // true
ColorFillLayerObject.kind == LayerKind.SOLIDFILL // true
Thanks !
Copy link to clipboard
Copied
You can check to see if it has a vector mask.
alert(isShapeLayer());
function isShapeLayer(){
var ref = new ActionReference();
ref.putEnumerated( charIDToTypeID('Lyr '),charIDToTypeID('Ordn'),charIDToTypeID('Trgt') );
desc = executeActionGet(ref);
if(!desc.hasKey(stringIDToTypeID('adjustment')) ) return false;
if(desc.getBoolean(stringIDToTypeID('hasVectorMask' )) == true) return true;
return false;
};
Copy link to clipboard
Copied
Thanks! I'll use this function .
Anyway I have the same "problem" again and again... AM seems to work just with activeLayer and I like to work with objects layers.
Thanks!