Skip to main content
Participating Frequently
September 28, 2021
Question

Insert Blank Page - every other page with Autoflow

  • September 28, 2021
  • 1 reply
  • 4696 views

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!

This topic has been closed for replies.

1 reply

brian_p_dts
Community Expert
Community Expert
September 28, 2021

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});
}
Participating Frequently
September 28, 2021

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....

brian_p_dts
Community Expert
Community Expert
September 30, 2021

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!


I just added a couple pages to your doc. The preview is the pages panel : Windows >> Pages