• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

[SCRIPT] Split spread of 2 pages into 2 spreads of 1 page

Enthusiast ,
Jul 09, 2024 Jul 09, 2024

Copy link to clipboard

Copied

Hello, how can I accomplish the same I'm doing mnually (in the link below), using javascript?

https://youtu.be/afsloq5D_RU


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.

TOPICS
Scripting

Views

528

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jul 09, 2024 Jul 09, 2024

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() {

...

Votes

Translate

Translate
Community Expert ,
Jul 09, 2024 Jul 09, 2024

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();

};

 

demo.gif 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 10, 2024 Jul 10, 2024

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):

 

Bildschirmfoto 2024-07-10 um 08.56.11.png

 

After the transformation there is plenty of space on all sides of the pages to apply bleed:

Bildschirmfoto 2024-07-10 um 08.56.21.png

 

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 )

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 10, 2024 Jul 10, 2024

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 10, 2024 Jul 10, 2024

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 )

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 10, 2024 Jul 10, 2024

Copy link to clipboard

Copied

Very interesting! You have given me something to consider. Thanks. - Mark

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 10, 2024 Jul 10, 2024

Copy link to clipboard

Copied

@lfcorullon

 

Why? 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 10, 2024 Jul 10, 2024

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 10, 2024 Jul 10, 2024

Copy link to clipboard

Copied

quote

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? 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 10, 2024 Jul 10, 2024

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

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 10, 2024 Jul 10, 2024

Copy link to clipboard

Copied

quote

 

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

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 10, 2024 Jul 10, 2024

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)

 

Screen Shot 8.png

 

The bleeds are correct in the exported PDF, and the trim is 8"x10"

 

Screen Shot 7.png

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 10, 2024 Jul 10, 2024

Copy link to clipboard

Copied

@rob day

 

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

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 10, 2024 Jul 10, 2024

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:

 

Screen Shot 10.png

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 10, 2024 Jul 10, 2024

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 10, 2024 Jul 10, 2024

Copy link to clipboard

Copied

Yes, I helped @lfcorullon with the code, but I wouldn’t use it.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 10, 2024 Jul 10, 2024

Copy link to clipboard

Copied

quote

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. 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 10, 2024 Jul 10, 2024

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 10, 2024 Jul 10, 2024

Copy link to clipboard

Copied

LATEST
quote

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 😉 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 10, 2024 Jul 10, 2024

Copy link to clipboard

Copied

quote

 

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? 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 10, 2024 Jul 10, 2024

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:

 

Screen Shot 6.png

 

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:

 

Screen Shot 5.png

 

So if you are doing that there is the risk of miscommunication.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 10, 2024 Jul 10, 2024

Copy link to clipboard

Copied

@rob day

 

But does your 8x10 includes punch holes?

 

Or the assumption is that printer will add required extra for the punch holes area? 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 10, 2024 Jul 10, 2024

Copy link to clipboard

Copied

With wire-o the punch holes are inside of the trim.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 10, 2024 Jul 10, 2024

Copy link to clipboard

Copied

quote

With wire-o the punch holes are inside of the trim.


By @rob day

 

You mean the area that will be cut off?

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 10, 2024 Jul 10, 2024

Copy link to clipboard

Copied

You mean the area that will be cut off?

 

This is the trim—AcrobatPro’s TrimBox:

 

Screen Shot 9.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines