Ways to select a group with different object statuses:
- Select the whole group — use the Selection Tool or click the circle next to the name in the Layers panel;
- Select all visible unlocked objects — use Group Selection Tool or click in the empty area to the right of the circle
In ExtendScript, changing the
selected attribute of a group does not help.
app.activeDocument.pageItems.selected = true;
If there are free objects at the beginning of the group, they will be selected, but the script will stop with an error (Error 9063) at the first locked or hidden object.
How to choose a group within which we don’t know the statuses of objects:
- Write a
whileloop that goes through the internal objects with the condition
if (obj.locked == false && obj.hidden == false(shortened
if (obj.editable == true) and sets attribute
obj.selected = true.
- Cycle through all objects, temporarily make them all visible and unlock them. Then select the group. But then you have to save all the statuses to a temporary array to return them at the end.