Copy link to clipboard
Copied
Hoping someone can help... I saw another post where a script can be used to insert a blank page every other page, however when I tried it, a single blank page was only added to the bottom of my document. I have a hunch its because I am using Autoflow on my content but am not sure...
Is there a way of overcoming this using scripting I wonder?
Alternatively what I am ultimatly trying to achieve is that my printing would occur on odd pages only while being ran through a batch job on a server. (Not locally using the print dialogue box where I can see the option for this)
Any help greatly appreciated!
Copy link to clipboard
Copied
Does this not work?
var doc = app.activeDocument;
var pages = doc.pages.everyItem().getElements();
for (var i = 0; i < pages.length; i+=2) {
doc.pages.add(LocationOptions.AFTER, pages[i], {appliedMaster : null});
}
Copy link to clipboard
Copied
Unfortunatly not ... do you think it is because I have Autoflow on my content item? The finished document could be hundreds of pages long and its all contained in content items with Autoflow... Thanks very much for the help....
Copy link to clipboard
Copied
Autoflow doesn't play a role. In Brian's script, remove
.everyItem().getElements()
from the second line and it works as expected. The reason is that the Pages object must be rebuilt every time you add one, so you can't work with the collection converted to an array.
Copy link to clipboard
Copied
Thanks very much, It's still producing multiple pages with just a single blank page at the end.. could it be because my content is contained in Table Structures that have settings for keeping rows together and widows and orphans do you think? etc.... appreciate the help...
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Please upload an idml document with the setup. Tables should not affect anything either.
Copy link to clipboard
Copied
Thanks very much I have tried it also on just a plain text box and cant get it working so im sure its something im doing wrong in my set up... Does it matter that I am using xPresso along with InDesign? I have attached the artifacts below - thanks alot! it wont allow me to upload an .xsd but its empty anyway just to demonstrate... Thanks again!
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Thank you for your time, I wonder what the output appears like using a preview? Sorry for the questions.. I'm missing something somewhere.. would be great to see a sample idml if possible but don't want to ask too much.. appreciate the help!
Copy link to clipboard
Copied
I just added a couple pages to your doc. The preview is the pages panel : Windows >> Pages
Copy link to clipboard
Copied
ah ok thank you again, so did you then manually add text to pages 3 and 5?
I am able to get the script to insert the page but when I use publish or preview to view the output the pages appears at the bottom of the entire document. What I would like is that it appears every second page. My Text is 'variable' coming from a datasource so that first page with the 'Ipsom Lorum....' should Autoflow onto page 3, 5, 7 etc with a blank page between each page with text... If you have manually added a blank page, then a page with text then a blank page then a page with text then I guess its not exactly what I was hoping for ? Could that be the case in your screenshot?
Copy link to clipboard
Copied
Your document (insert page test lorum ipsom.indd) contains just one page with an overset text frame on it. The script that Brian posted (and my variant of it) assume that the document is paginated. So what you want is a script with two functions: (1) add pages until there's no more overset text and (2) insert a blank page after every second page. Or, better yet, add pages until there is nolonger any overset text, but place the text frames only on rectos.
Copy link to clipboard
Copied
You need to run your plugin to paginate the pages before running the script. Yes I added pages manually.
Copy link to clipboard
Copied
Thanks very much, when you say run your plug in before running the script... what plug in would that be? I just use publish really through xpresso to generate amd paginated at the same time... Appreciate the help... !
Copy link to clipboard
Copied
Thanks very much this does seem to be more like the script I would need alright... I wonder is there a repository of InDesign references or objects or commands that I could refer to somewhere ie when you say recto or overset text... if I had that maybe I could better make this type of script as it doesn't seem to be out there currently... thanks again for your time and feedback its much appreciated.
Copy link to clipboard
Copied
'Overset text' is the text that doesn't fit in a frame, and dangles in limbo. It is exposed when you enlarge the frame or thread the frame to another one. 'Recto' is a right-hand page, that's a general term, not specifically InDesign.
There's no repository as such. You can find a lot on Google. A reference book on InDesign with a good index is useful.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now