Finding the position of pathItems AND compoundPathItems
I can find the location of ‘pathItems’ and I can find the location of ‘compoundPathItems’, but how do I combine the two scripts so I get the location of all the pathItems and all the compoundPathItems in one script??
I am sharing a highly reduced version of the relevant part of my code. I will not be using alert(), but that’s another story.
// SCRIPT 1
function getTopLeft() {
for (var i = 0; i < app.activeDocument.pathItems.length; i++) {
var foo = app.activeDocument.pathItems[i].position[0];
alert(foo);
}
}
getTopLeft();
// SCRIPT 2
function getTopLeft() {
for (var i = 0; i < app.activeDocument.compoundPathItems.length; i++) {
var foo = app.activeDocument.compoundPathItems[i].position[0];
alert(foo);
}
}
getTopLeft();