Copy link to clipboard
Copied
Hi Guys,
I am new to scripting, I am able to check the closed paths but I am struck in some problem.
Whenever I delete some segments from closed path and rejoin leaving a particular segment outside a newly made closed path, my script fails to recognize the opened path. have attached the screen shots.
In the second image after deleting the segment i am not able to recognize the path which is out segment that closed path.
Here is my code:
var thePathed = app.activeDocument;
for (var a = 0; a < thePathed.pathItems.length; a++)
{
app.activeDocument = thePathed;
var aPath = thePathed.pathItems;
for (var b = 0; b < aPath.subPathItems.length; b++)
{
if (aPath.s...
Any suggestions on this is appreciable.
Thank you in advance.....
Regards,
Annesh MRD
I think I see what is wrong. You edited the path in a way that made it a complex path not seperate paths.
Try this
var thePathed = app.activeDocument;
for (var a = 0; a < thePathed.pathItems.length; a++)
{
app.activeDocument = thePathed;
var aPath = thePathed.pathItems;
for (var b = 0; b < aPath.subPathItems.length; b++)
{
if ( aPath.subPathItems.operation == ShapeOperation.SHAPEXOR || aPath.subPathItems.closed == false )
{
alert("Error in Path Name: "+ aPath.name)
}
}
}
alert ("Path checking Finished")
Copy link to clipboard
Copied
Your code does give a 'Error in Path' alert for me if there is an open subpath.
Copy link to clipboard
Copied
Thank you....
Still I have some problem.
Here I am attaching the screen shot with the lable ABC.
A -- I have created the path for full image
B -- deleted two segments in path
C -- After deleting I closed the path of below portion, the path of the above potion is open only
After running the script its not showing any error even through path of the above portion is open.
Copy link to clipboard
Copied
Your second image is 'QUEUED' so I can see it now. I did follow your instructions in the frist post and the script found the open path. Could you try posting a jpg with the path that causes you trouble? JPG files support paths so the path will be in the file. PNG does not.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
I think I see what is wrong. You edited the path in a way that made it a complex path not seperate paths.
Try this
var thePathed = app.activeDocument;
for (var a = 0; a < thePathed.pathItems.length; a++)
{
app.activeDocument = thePathed;
var aPath = thePathed.pathItems;
for (var b = 0; b < aPath.subPathItems.length; b++)
{
if ( aPath.s...
Copy link to clipboard
Copied
Thank you very much, now it's finding.....
Find more inspiration, events, and resources on the new Adobe Community
Explore Now