Quantcast
Channel: Adobe Community: Message List - InDesign Scripting
Viewing all articles
Browse latest Browse all 37788

Re: Help with Combine Docs script

$
0
0

Hi,

 

@Uwe, @Davey,

 

It looks like page.duplicate() works over this limit...!

 

@Davey

You need to control adding spreads while duplicating pages...

There are also some facingPages and allowPageShuffle implications...

There could be a problem with masterSpread's pageItems as well ==> I mean lack of them in target doc.

 

Here is a code which basically works:

function combine() {
var      newDoc = app.documents.add(),     docsPages = [],     v, i;      for (v = 0; v < myFiles.length; v++) {          docsPages = app.documents.item(myFiles[v]).pages.everyItem().getElements();          for (i = 0; i < docsPages.length; i++) {               if (newDoc.pages.length % 2 == 1 ) {                    newDoc.spreads.add({allowPageShuffle: false});                    docsPages[i].duplicate(LocationOptions.AT_BEGINNING, newDoc.spreads[-1]);                    if (v == 0 && i == 0) newDoc.spreads[0].remove();                    while (newDoc.spreads[-1].pages.length > 1) newDoc.spreads[-1].pages[-1].remove();               }else docsPages[i].duplicate(LocationOptions.AT_END, newDoc.spreads[-1]);          }     }}

 

myFiles should be an array with doc.names

 

Jarek


Viewing all articles
Browse latest Browse all 37788

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>