Skip to content

Instantly share code, notes, and snippets.

@bastien
Created June 21, 2012 11:19
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 bastien/2965196 to your computer and use it in GitHub Desktop.
Save bastien/2965196 to your computer and use it in GitHub Desktop.
Imports a single page InDesign document into another
var doc = app.activeDocument;
var docPath = doc.fullName;
var importDoc = app.open(File('~/test_extract.indd'), false);
var pageToImport = importDoc.pages.firstItem();
importDoc.pages.add(LocationOptions.AT_END); // Documents must have at least 1 page
pageToImport.move(LocationOptions.AFTER, doc.pages.firstItem());
doc.pages.item(2).remove();
importDoc.close(SaveOptions.no);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment