This script allows you to turn on the Photoshop Path to all images in a document. Seems to work great except when there is other files linked with without a clipping path layer, such as an Ai logo file or csv data source. Can anyone help me revise so it only selects jpg and psd files instead of all linked items?
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;
app.doScript(resetClippingPath, ScriptLanguage.JAVASCRIPT, [], UndoModes.ENTIRE_SCRIPT, “Clipping Path On – NEW”)
function resetClippingPath(){
var allOpenDocs = app.documents;
for(var m=0;m<allOpenDocs.length;m++){
var d=allOpenDocs[m];
var linksIDs = d.links.everyItem().id;
for(var n=0;n<linksIDs.length;n++){
try{
d.links.itemByID(linksIDs[n]).parent.parent.graphics[0].clippingPath.clippingType = ClippingPathType.PHOTOSHOP_PATH;
}catch(e){};
};
};
};