Copy link to clipboard
Copied
Hello,
I have the problem to access the elements of a group with javascript.
var vDocRef = app.activeDocument;
var vSelection = vDocRef.selection;
var vLen = vSelection.length;
for (var i = 0; i < vLen; i++) { // for-03
vName = vSelection[i].name;
alert(i + " " + vName + " " + vSelection[i].typename);
if (vSelection[i].typename == "GroupItem") {
// how to access to the group elements?
alert("gruppe " + vSelection[i].groupItems.length); // is 0, but why?
}
}
But the alert shows only/allways zero (0) and I can't access the elements of the group. What can I do?
Jens.
Copy link to clipboard
Copied
alert("gruppe " + vSelection[i].pageItems.length);
Copy link to clipboard
Copied
Hello and thanks for the tip. That will do it. Now I can write my script to the end.