Skip to content

Instantly share code, notes, and snippets.

@milligramme
Last active February 8, 2017 02:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save milligramme/a33ff29d77afe8bfc6cdec9df51b60b9 to your computer and use it in GitHub Desktop.
Save milligramme/a33ff29d77afe8bfc6cdec9df51b60b9 to your computer and use it in GitHub Desktop.
//@target "indesign"
var sel = app.selection[0];
var ret = find_parent(sel, 'Group');
function find_parent (obj, constructor) {
if (obj.parent.parent.constructor.name !== constructor) {
return obj.parent
}
else {
return arguments.callee(obj.parent, constructor);
}
return null
}
if (ret) {
ret.select();
}
// page/spread/story
// top-level-group ---> select this group
// parent-parent-group
// parent-group
// target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment