Answered
How do I determine that it's part of the group?
If you can assume the selection has only 2 objects (?), a group and a recatangle:
var s = app.activeDocument.selection
var ob, gb;
for (var i = 0; i < s.length; i++){
if (s[i].constructor.name != "Group") {
//the group’s bounds
ob = s[i].geometricBounds
} else {
//the page item outside of the group
gb = s[i].geometricBounds
}
};
$.writeln("Group’s bounds: " + gb + "\rObjects’s bounds: " + ob)
//your sample returns
//Group’s bounds: 50.5000000000001,20,105.306988143723,99.4833333333335
//Objects’s bounds: 64.7548342169696,120,100,172.867748674545Sign up
Already have an account? Login
To post, reply, or follow discussions, please sign in with your Adobe ID.
Sign inSign in to Adobe Community
To post, reply, or follow discussions, please sign in with your Adobe ID.
Sign inEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.

