Copy link to clipboard
Copied
Hello guys,
Again I am coming with a need for help now.
I need a automation or plugin or script for spotting error on Photoshop paths.
I tried photoshop scripts, searched for options in indesign and other softwares like pdf preflights. I couldn't find any idea.
I will be working with lots of images more or less 100 images a day. I want to get the infos of clipping paths created in photoshop like path name, clipping flatness and open paths if any, all details in a log file or an log display window. Not an issue whether it works inside photoshop or outside like automation along with other softwares. But I simply need to spot the open path and clipping path name exactly.
Need help!!!
Thank you in advance!
Regards,
Purushoth...
Copy link to clipboard
Copied
function clippingPathIndex(){// returns -1 if no clipping path
var ref = new ActionReference();
ref.putEnumerated( charIDToTypeID("Dcmn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
var desc = executeActionGet(ref);
return desc.getObjectValue(stringIDToTypeID('clippingPathInfo')).getInteger(stringIDToTypeID('clippingPathIndex'));};
function getClippingPathFlatness(){
var ref = new ActionReference()
ref.putEnumerated( charIDToTypeID("Dcmn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
var desc = executeActionGet(ref);
if( desc.getObjectValue(stringIDToTypeID('clippingPathInfo')).getInteger(stringIDToTypeID('clippingPathIndex')) != -1 ){
return (desc.getObjectValue(stringIDToTypeID('clippingPathInfo')).getInteger(stringIDToTypeID('clippingPathFlatness'))/65536);
}else{
return -1;
}};
var pathIndex = clippingPathIndex();
if(pathIndex != -1 ){
var pathName = app.activeDocument.pathItems[pathIndex].name;
var flatness = getClippingPathFlatness();
var closed = app.activeDocument.pathItems[pathIndex].subPathItems[0].closed;
alert(pathName+': '+flatness+': '+closed);}
Copy link to clipboard
Copied
Hello Mike,
Path name and flatness works great. But closed is not working. I want to know whether the path is completed or not. I mean joined. I have attached a snapshot. Pls advise.
Thank you!
Purushoth.
Copy link to clipboard
Copied
I tried Mike's code and it worked just fine here…?
Copy link to clipboard
Copied
The closed variable assumes that the path only has one subPath. At least it only checks the first subPath. It uses the Photoshop Object Model to check a property. I don't know why it would not work correctly unless there is more than one subPath.
Copy link to clipboard
Copied
May I know why you divided clippingPathFlatness by 65536?
Copy link to clipboard
Copied
May I know why you divided clippingPathFlatness by 65536?
By @Mahadi_hasan
Sadly Michael has passed, gone but certainly not forgotten.
I'm guessing that it may have something to do with: