Script to check all PathItem Names
Hi,
I've something like this:
var doc = activeDocument;
var pArray = [];
var pLen = doc.pathItems.length
alert ("Number of Path Found :" + pLen);
for (var i = 0; i < pLen; i++) {
pArray.push(doc.pathItems[i].name)
var curPath = doc.pathItems.getByName(pArray[i]);
alert (curPath);
}
but it give me the name in alert for each path found : 3 paths -> 3 alerts
I try to see if there's a way to have all paths name found all together, and not step by step
In fact, want to do this :
In image, found paths, and check if a path is named "DetPath". If not, then select the first path to rename it "DetPath"
My issue is when the second, or third path is named "DetPath", and not the first, it renamed the first path "DetPath", but script stopped because the second path already named "DetPath"....
So before it have to rename, first check all names found then let's go, you can rename, or not (then alert that there already have a path named correctly iin image)
Hope it's clear 😉