Skip to content

Instantly share code, notes, and snippets.

@milligramme
Created June 21, 2011 05:32
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/1037300 to your computer and use it in GitHub Desktop.
Save milligramme/1037300 to your computer and use it in GitHub Desktop.
for indesign select next item in group object
/**
* 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