Question
Without 'allObject StyleGroups', cannot traverse all groups?
There are allOjcetStyles, but there is no 'allObject StyleGroups'.
Is there any way to correct the following code so that it can recognize all situations of groups, including nested groups within groups.
var creGroup = newGroup("myGroup", "objectStyleGroups");
function newGroup(grn, sgc) {
var d = app.activeDocument;
for (var i = 0; i < d[sgc].length; i++) {
if (d[sgc][i].name == grn) {
return true
break
}
}
return d[sgc].add({ name: grn });
}
