How to add a header child to array
I am trying to create a script that iterates thru the selected pathItems on the artboard and adds their name to an array but at the start of each group of pathItems that have the same name I would like a header child.
Artboard pathItems:
3 - pathItem.name = lemon
2 - pathItem.name = orange
3 - pathItem.name = peach
Header child:
pathObj.addChild("These are lemons:");
pathObj.addChild("These are oranges:");
pathObj.addChild("These are peaches:");
Resulting array:
[These are lemons:, lemon, lemon, lemon, These are oranges:, orange, orange, These are peaches:, peach, peach, peach]
Any help would be greatly appreciated.
