Copy link to clipboard
Copied
Hello, how can I accomplish the same I'm doing mnually (in the link below), using javascript?
I tried the following code, but the right pages doesn't move.
var doc = app.activeDocument;
var sp = app.activeWindow.activeSpread;
var p1 = sp.pages[0];
var p2 = sp.pages[1];
sp.allowPageShuffle = false;
p2.move(LocationOptions.AFTER , sp , BindingOptions.RIGHT_ALIGN);
Thanks in advance.
Hi @lfcorullon, yes it could definitely be easier. But here is some code that works, at least in the basic case. Let me know if it is what you were thinking.
- Mark
/**
* @file Split Spread.js
* Split a double facing-page spread into two spreads, preserving sided-ness.
*
* CAUTION: not tested beyond the basic case!
*
* @author m1b
* @discussion https://community.adobe.com/t5/indesign-discussions/script-split-spread-of-2-pages-into-2-spreads-of-1-page/m-p/14729224
*/
function main() {
...
Copy link to clipboard
Copied
Hi @lfcorullon, yes it could definitely be easier. But here is some code that works, at least in the basic case. Let me know if it is what you were thinking.
- Mark
/**
* @file Split Spread.js
* Split a double facing-page spread into two spreads, preserving sided-ness.
*
* CAUTION: not tested beyond the basic case!
*
* @author m1b
* @discussion https://community.adobe.com/t5/indesign-discussions/script-split-spread-of-2-pages-into-2-spreads-of-1-page/m-p/14729224
*/
function main() {
splitDoublePageSpread(app.activeDocument.layoutWindows[0].activeSpread);
};
app.doScript(main, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, 'Split Spread');
/**
* Split a double facing-page spread
* into two spreads, preserving sided-ness.
* @author m1b
* @version 2024-07-10
* @param {Spread} spread - an Indesign Spread.
*/
function splitDoublePageSpread(spread) {
if (
'Spread' !== spread.constructor.name
|| !spread.isValid
)
throw Error('splitDoublePageSpread: bad `spread` supplied.');
if (2 !== spread.pages.length)
throw Error('splitDoublePageSpread: expected 2 pages per spread.');
// the right-hand page
var page = spread.pages.lastItem();
spread.allowPageShuffle = false;
// add the new spread (note: it will also add two unwanted pages)
var newSpread = spread.parent.spreads.add(LocationOptions.AFTER, spread, { allowPageShuffle: false });
// slot the page in between the two unwanted pages
page.move(LocationOptions.AFTER, newSpread.pages.firstItem());
// remove the unwanted pages
newSpread.pages.lastItem().remove();
newSpread.pages.firstItem().remove();
};
Copy link to clipboard
Copied
Hi @lfcorullon ,
in case you need this for adding bleed to the spine I have another suggestion:
[1] Make sure that the pasteboard below and above the pages is at least double the height of the page plus some extra space.
[2] Move one of the pages plus its contents down so that the right edge of the left page does not touch the left edge of the right page in the spread.
Both pages still share the same spread.
To accomplish this without scripting is relatively easy by using the Page tool to select a page and the Transform panel to move the selection.
From my German InDesign, where I checked the option "Move objects with page" from the Control panel.
The page is selected with the Page tool, the Transform panel's Y value is set to 305 mm (page height in my case is 297 mm):
After the transformation there is plenty of space on all sides of the pages to apply bleed:
In case you need to do this for more pages in a document, simply select the Page tool first, then open the Pages panel and cmd select (Ctrl select on Windows) all pages you want to move before using the Transform panel.
Regards,
Uwe Laubender
( Adobe Community Expert )
Copy link to clipboard
Copied
Hi @Laubender, I never would have thought of that! What is a case where it would be worth having the pages offset like this on the same spread versus on separate spreads? It seems a bit awkward.
- Mark
Copy link to clipboard
Copied
@m1b said: "What is a case where it would be worth having the pages offset like this on the same spread versus on separate spreads? It seems a bit awkward."
Not awkward at all, I think. It's a matter of personal workflow if you like to see both pages in one spread or in two different ones when doing changes in the layout.
Regards,
Uwe Laubender
( Adobe Community Expert )
Copy link to clipboard
Copied
Very interesting! You have given me something to consider. Thanks. - Mark
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Why?
If you are doing it from the UI, it would usually be to add an extended inside bleed for binding methods where the inside edge is trimmed and visible, not folded. Something like Wire-o.
Copy link to clipboard
Copied
Why?
If you are doing it from the UI, it would usually be to add an extended inside bleed for binding methods where the inside edge is trimmed and visible, not folded. Something like Wire-o.
By @rob day
Why not include it in the page size?
Copy link to clipboard
Copied
Why not include it in the page size?
The trim and bleed boxes/marks would be wrong in an exported PDF, and crossovers wouldn’t work.
If the inside edge is exposed I would do this:
https://community.adobe.com/t5/indesign-discussions/gutter-bleed-still-the-same/m-p/11367643#M198592
Copy link to clipboard
Copied
Why not include it in the page size?
The trim and bleed boxes/marks would be wrong in an exported PDF, and crossovers wouldn’t work.
If the inside edge is exposed I would do this:
https://community.adobe.com/t5/indesign-discussions/gutter-bleed-still-the-same/m-p/11367643#M198592
By @rob day
I'm pretty sure printing shop can handle those special circumstances.
I'm case of crossovers - you need to place the same image twice and shift it anyway - I'm pretty sure it would be much easier / quicker to do it on the same spread - rather then on two different spreads.
Then - can't check it right now - but how will PDF look like? Especially, if client wants to see spreads...
Copy link to clipboard
Copied
case of crossovers - you need to place the same image twice and shift it anyway
On a straight crossover you can leave the spread as is—no gap for the bleed—in that case the bleed comes from the opposite page and there is no need to split the art. Here the with Facing Pages turned off, the top spread is pulled apart and orange filled rectangle stops at the inside trim. The bottom spread is attached at the spine, and the cyan filled A crosses over (its spread is not pulled apart)
The bleeds are correct in the exported PDF, and the trim is 8"x10"
Copy link to clipboard
Copied
I think I know how bleed works for folded 😉
So the yellow + cyan is rather obvious.
But if you take pages apart - and move to separate spreads...
Copy link to clipboard
Copied
But if you take pages apart - and move to separate spreads...
This is a non facing page document set up as spreads. With non facing pages you have the option to move the spread pages apart for an extended bleed or leave them connected. You can’t do what I’m showing with a facing page document, and because the spread pages can be pulled apart, there is no need to move the pages to separate spreads:
Copy link to clipboard
Copied
But you've created script for that?
Copy link to clipboard
Copied
Yes, I helped @lfcorullon with the code, but I wouldn’t use it.
Copy link to clipboard
Copied
Yes, I helped @lfcorullon with the code, but I wouldn’t use it.
By @rob day
And that's why I've asked "why" - what is his reason to move pages to separate spreads.
Copy link to clipboard
Copied
And that's why I've asked "why" - what is his reason to move pages to separate spreads.
If, for some reason, the document was created as Facing Pages, it might be easier to split the pages that need an inside bleed to individual spreads, rather than change a complex existing document to non facing pages.
Copy link to clipboard
Copied
And that's why I've asked "why" - what is his reason to move pages to separate spreads.
If, for some reason, the document was created as Facing Pages, it might be easier to split the pages that need an inside bleed to individual spreads, rather than change a complex existing document to non facing pages.
By @rob day
Right, but then somehow we've drifted away 😉
Copy link to clipboard
Copied
The trim and bleed boxes/marks would be wrong in an exported PDF
By @rob day
In what way they would be wrong?
They'll be more correct than if you will work on an "usable" part of the page without the space for punch holes.
Unless I'm missing something?
Copy link to clipboard
Copied
In what way they would be wrong?
If the document’s Width and Height are 8"x10" (the trim), and the bleed is .125", an exported PDF’s trim and bleed box would be this:
If you add an extra .125" to the pages the trim is 8.125" not the desired 8" and you would get this in the PDF:
So if you are doing that there is the risk of miscommunication.
Copy link to clipboard
Copied
But does your 8x10 includes punch holes?
Or the assumption is that printer will add required extra for the punch holes area?
Copy link to clipboard
Copied
With wire-o the punch holes are inside of the trim.
Copy link to clipboard
Copied
With wire-o the punch holes are inside of the trim.
By @rob day
You mean the area that will be cut off?
Copy link to clipboard
Copied
You mean the area that will be cut off?
This is the trim—AcrobatPro’s TrimBox: