Created
June 21, 2011 05:32
-
-
Save milligramme/1037300 to your computer and use it in GitHub Desktop.
for indesign select next item in group object
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
/** | |
* select next object in group object | |
*/ | |
#target 'InDesign' | |
// select a pageitem in group object | |
if (app.selection.length === 0) {exit();}; | |
if (app.selection[0].parent.constructor.name !== 'Group') {exit()}; | |
var current_sel = app.selection[0]; | |
var current_id = current_sel.id; | |
var parent_group = current_sel.parent; | |
for (var i=0, iL=parent_group.pageItems.length; i < iL ; i++) { | |
if (parent_group.pageItems[i].id === current_id) {// current object | |
// select next object | |
parent_group.pageItems[(i+1)%iL].select(); | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment