Illustrator Scripting - Combining/Merging multiple CompoundPathItem into one
Hey guys,
I would like to combine/merge multiple CompoundPathItem into a single one.
Has anyone done something similar previously?
My code so far looks like this:
var flattened = doc.activeLayer.compoundPathItems.add();
for (var i = 0; i < compoundPaths.length; i++) {
var currCompoundPath = compoundPaths[i];
var currPathItems = currCompoundPath.pathItems;
for (var j = 0; j < currPathItems.length; j++) {
var currPathItem = currPathItems[j];
flattened.pathItems.add(currPathItem);
}
}
But apart from copying over the pathItems that a CompoundPathItem contains it doesn't do much more.
I think I am missing something, any help would be appreciated!
