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

Re: Help with Combine Docs script

$
0
0

@Davey & Jarek – I don't need the example files for testing. Just created a document with 11 pages in spread one!

 

Before:
Simple document, two pages with different bounds:

 

TwoDifferentPages-BEFORE-SCRIPT.png

 

After running the script below:

 

SpreadOneWith11pages-AFTER-SCRIPT.png

 

//Adding10pagesToSpreadOne_ACTIVE-DOCUMENT.jsx//Uwe Laubender //USING ONE INDESIGN-DOCUMENT /**
* @@@BUILDINFO@@@ EXAMPLE_Duplicate_LastPage_AFTER_FirstPage_10x.jsx !Version! Mon Jan 13 2014 11:02:14 GMT+0100
*/ //See discussion at: //myDavey//Help with Combine Docs script//http://forums.adobe.com/thread/1377713?tstart=0 //TESTED WITH ONE DOUBLE SIDED DOCUMENT://2 pages//Different bounds !! //InDesign CS5.5 on OSX 10.6.8 //RESULT: 11 [ ! ] PAGES IN THE FIRST SPREAD !! 
var d=app.documents[0];
var myLimit = 10;
var firstPage = d.pages[0];
var secondPage = d.pages[1];
$.writeln("firstPage.bounds"+"\t"+firstPage.bounds);
$.writeln("secondPage.bounds"+"\t"+secondPage.bounds); /*
Just an example in MILLIMETERS:

firstPage.bounds        0,0,296.999999999461,209.999999999936
secondPage.bounds       0,0,200,290

*/ //THAT WILL THROW AN ERROR, IF FIRST PAGE is://"[1]" and not "1" //WILL WORK IN A TWO-PAGES DOCUMENT, IF THE PAGE BOUNDS OF PAGE 1 ARE DIFFERENT FROM PAGE 2 for(var n=0;n<10;n++){    var lastPage = d.pages[-1];    try{    lastPage.duplicate(LocationOptions.AFTER,firstPage);    }catch(e){$.writeln(e.toSource())};    }/*    CASE 1:    All pages same bounds    => 10 pages are added AFTER page 1 => several new spreads    CASE 2:    Two pages with DIFFERENT bounds    2.1 Spread 1 is "[1]" INSTEAD OF "1"    => 9 pages are added AFTER page 1 => same spread    ERROR:    Result after adding 9 pages to page 1:    (new Error ("Ein Druckbogen kann maximal 10 Seiten enthalten."))    Roughly translated from my German ESTK:    (new Error ("One spread can contain a maximum of 10 pages."))    2.2 Spread 1 is "1" INSTEAD OF "[1]"    => 10 [ ! ] pages are added to spread 1 => exceeding the limit of 10 pages per spread !!

*/

 

//EDIT:

Yes! I am excited!

Will do further testing…

 

Uwe

 

Message was edited by: Laubender


Viewing all articles
Browse latest Browse all 37788

Trending Articles



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