Advertisement
ViktorEngard

Renumber Footnotes in InDesign Book

May 21st, 2020
568
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #target indesign
  2.  
  3. var doc;
  4. var footnoteCount=1;
  5. if((app.books.length==1) && (app.documents.length==0)) {
  6.     var bookFiles=app.books[0].bookContents.everyItem().fullName;
  7.     if(bookFiles.length>1) {
  8.         doc=app.open(bookFiles[0], false, OpenOptions.OPEN_ORIGINAL);
  9.         setFootnoteOptions();
  10.         for(var i=1; i<bookFiles.length; i++) {
  11.             footnoteCount+=doc.stories.everyItem().footnotes.everyItem().id.length;
  12.             doc.close(SaveOptions.YES);
  13.             doc=app.open(bookFiles[i], false, OpenOptions.OPEN_ORIGINAL);
  14.             setFootnoteOptions();
  15.             }
  16.         doc.close(SaveOptions.YES);
  17.         }
  18.     }
  19.  
  20. function setFootnoteOptions() {
  21.     doc.footnoteOptions.restartNumbering=FootnoteRestarting.DONT_RESTART;
  22.     doc.footnoteOptions.startAt=footnoteCount;
  23.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement