First of all, thank you to everyone helping me try to work this out.
Please be patient with me as I'm new to scripting and a complete beginner that only understands the basics.
Ok, so, I'm working on a side project for where I work. The aim is to develop a script that will allow users to run it and automatically add 4 pages at a time. These pages will be in Spreads (Facing pages).
We (the company) print booklets of a sort, and due to printing in Printers Spreads, this is how all our templates are setup. This isn't necessarily how it should be done, or how I would setup the templates, but that's how it is and I have to work with what I have.
Due to this, I can't use the build in feature that is already in InDesign for Smart Text Reflow, but this is basically what I set out to achieve.
I have been looking around the Internet for a while and found a few different scripts that are already out there that work to a certain degree, but not exactly how I need them to work.
Below I will demonstrate what I would like to achieve:
Below is an example of how we have our template set up.
All the scripts I have found and tried to adapt to what I want seem to do the following actions:
All they will do is add one page at a time and in the wrong place (this should be on the left, NOT the right).
When adding the second page (via the menu interface or by editing any script I find) the second page gets added like this:
Now I already know that this is due to how we have our templates setup, but I can't change that!
However, if the following functions is used via the interface menu, then the results work perfectly:
It's this function I'd like to reproduce but in script form:
At End of Document.
If anyone could help shed some light on this, it would be extremely beneficial.
Current examples of scripts I've been experimenting with are:
myDocument = app.activeDocument myDocument.spreads.item(1).allowPageShuffle = true; var page=myDocument.spreads.item(1).pages.item(1); var pages= myDocument.pages.add(LocationOptions.atEnd); var pages= myDocument.pages.add(LocationOptions.atEnd); myDocument.spreads.item(1).allowPageShuffle = false;
Again, thank you in advance.
Typical, soon after posting this I actually figure it out.
For anyone that's interested, this seems to work fine:
myDocument = app.activeDocument var page=myDocument.spreads.item(0).pages.item(0); var pages= myDocument.spreads.add(LocationOptions.atEnd);