[CS4] Check If Image Has Clipping Path

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

Danny Noonan

[CS4] Check If Image Has Clipping Path

Post by Danny Noonan »

Thanks for your help Mike.
The script you have supplied works exactly the way I asked. However, I chose my words poorly. What I was trying to ask for is a script to determine weather a file has a Normal Path or Work Path or even a Clipping Path, not necessarily just an active Clipping Path. I looked at the OMV to try changing the script myself, but I don't see what to change.
I think I have to change - ("Clpg") - on line 22:
var clippingPath = desc.getObjectValue(charIDToTypeID("Clpg"));

but what do I change it to, is that even what needs to be changed?
Thanks for any more help Mike and I am sorry for the confusion.

Danny
Mike Hale

[CS4] Check If Image Has Clipping Path

Post by Mike Hale »

Action Manger will not help if you are just checking to see if the doc has any path that is not a vectormask or textmask. The function below will return true if the activeDocument has a workpath or an named path.
Code: Select allfunction hasPath(){
    return app.activeDocument.pathItems.length>0 && app.activeDocument.pathItems[0].kind != PathKind.VECTORMASK && app.activeDocument.pathItems[0].kind != PathKind.TEXTMASK;
}
Replace hasClippingPath() with this function and remember to change the function call.