Copy link to clipboard
Copied
The activeDocument.selected property provides access to an array of objects (the selected objects). The array elements are of types "PathItem," "TextFrame," "GroupItem," etc.
If I view this in the Data Browser, and expand one of the "GroupItem" elements, I do not see the other paths, text, subgroup objects that compose this group. Although the documentation says that "groupItems" is a property of the GroupItem class, I do not see this property in the Data Browser, so there is nothing to expand to see the object hierarchy. Furthermore, without access to a groupItems property, there doesn't appear to be a way to use a getByName method to get any of the objects that way.
Why doesn't the "groupItems" property of a GroupItem object show up in the Data Browser?
How does one access the various objects (text, paths) that comprise a GroupItem?
Thanks!
Ben
Ben, the data browser does not work in that depth… Script Debugger for AppleScript has an object navigator/viewer that does this and its great you can dig right down into your docs and see all the properties and their values… If you want more info then you are best having your script write what it is your looking for back the the ESTK console… To do this use…
$.write(someData); $.writeln(someData);
So you can for instance…
var doc = app.activeDocument; // I know I have this var lay = doc.layers.g
...Copy link to clipboard
Copied
"groupItems" is a property of the GroupItem class"
it gives you access to groups inside groups, if you have group A and group B, both grouped together into group C, then
groupItems["group C"].groupItems[0]; // returns group A
groupItems["group C"].groupItems[1]; // returns group B
groupItems["group B"].pageItems[0]; // returns whatever first item is inside group B
//same as
groupItems["group C"].groupItems[1].pageItems[0]; // returns whatever first item is inside group B
Copy link to clipboard
Copied
Ben, the data browser does not work in that depth… Script Debugger for AppleScript has an object navigator/viewer that does this and its great you can dig right down into your docs and see all the properties and their values… If you want more info then you are best having your script write what it is your looking for back the the ESTK console… To do this use…
$.write(someData); $.writeln(someData);
So you can for instance…
var doc = app.activeDocument; // I know I have this var lay = doc.layers.getByName('Layer 1'); // Ditto this too var grp = lay.groupItems.getByName('Blah'); // Ditto this too
var grpItems = grp.pageItems; for ( var i = 0; i < grpItems.length; i++ ) { $.writeln(grpItems.typename); }
Find more inspiration, events, and resources on the new Adobe Community
Explore Now