Hey, Guys,
Im really sorry if this is solved topic already, but could someone help me with functionality of this script? It looks like it works fine but it shows that no clipping path is avaible, even when there are clipping paths with the same name in every picture of the document.
Script:
main();
function main(){
var
i, j, allGraphics,
allGraphicsArrays = app.activeDocument.pages.everyItem().allGraphics;
for (var i=0; i<allGraphicsArrays.length; i++) {
var myObject = allGraphicsArrays[i];
for (j=0; j<myObject.length; j++) {
try{
myObject.pageItems.item(0).clippingPath.appliedPathName = myObject.pageItems.item(0).clippingPath.photoshopPathNames[0];
myObject.pageItems.item(0).clippingPath.clippingType = ClippingPathType.PHOTOSHOP_PATH;
}
catch (myError) {
// If it can’t apply the Photoshop path then it obviously does not have one
alert(“Selected image does not have a Photoshop path applied”)
}
}
}
}