I have a compound path, which I want to use as a clipping path.
so, I set the "clipping" property of it's child pathItems to "true", then added them all to a clipped layer, as the following code snippet shows:
// get the image to be clipped
var placedArtItem = templateDoc.groupItems.createFromFile(artFileRef );
// get the clipping path and set it to clipping
var backClipPath = artLayer.compoundPathItems[0];
backClipPath.pathItems[0].clipping = true
// group and clip
var clippingGroup = artLayer.groupItems.add();
clippingGroup.name = "clip Group";
backClipPath.move(clippingGroup , ElementPlacement.PLACEATEND );
placedArtItem.move( clippingGroup , ElementPlacement.PLACEATEND );
clippingGroup.clipped = true;
this way, is working great in case the path is normal pathItem and not a compoundPathItem.
But with compoundPathItem, it only group but don't clip, do any one know how to do it with compoundPathItem.