Last active
February 8, 2017 02:31
-
-
Save milligramme/a33ff29d77afe8bfc6cdec9df51b60b9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//@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