Skip to main content
dublove
Legend
June 18, 2026
Question

Without 'allObject StyleGroups', cannot traverse all groups?

  • June 18, 2026
  • 0 replies
  • 0 views

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 });
}