Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Clipping Path info

New Here ,
Dec 20, 2012 Dec 20, 2012

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...

TOPICS
Actions and scripting

Views

1.3K
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Guru ,
Dec 21, 2012 Dec 21, 2012

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);

}

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 16, 2013 May 16, 2013

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.

Screen shot 2013-05-16 at 7.18.49 PM.png

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
May 16, 2013 May 16, 2013

Copy link to clipboard

Copied

I tried Mike's code and it worked just fine here…?

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
May 16, 2013 May 16, 2013

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.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 11, 2023 Aug 11, 2023

Copy link to clipboard

Copied

May I know why you divided clippingPathFlatness by 65536?

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 11, 2023 Aug 11, 2023

Copy link to clipboard

Copied

LATEST
quote

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:

 

https://en.wikipedia.org/wiki/65,536#In_computing

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines