I am using the bookContents.add function and I am trying to use the 'at' argument. I set this to the value 0 which I would expect to be the start of a book considering -1 the default value would add it to the end of the book however it adds the document after the first document in the book. WHY?
newBook.bookContents.add(File(outputLocation + saveName + ".indd"), 0);
@Matt – if you want to add a file to the beginning of the bookContents collection, first add it to the list and then move it to the beginning:
//Adding the active document at the beginning of the listed Indesign files of a book file: var d=app.activeDocument; var b= app.books; //Add the active document to the end of the list: b.bookContents.add(d.fullName,-1,undefined); //Move it before the first item of the collection: b.bookContents[-1].move(LocationOptions.AT_BEGINNING,b.bookContents);
Thanks for this! Worked like a treat