• 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

527

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 10, 2024 Jul 10, 2024

Copy link to clipboard

Copied

quote

You mean the area that will be cut off?

 

This is the trim—AcrobatPro’s TrimBox:


By @rob day

 

Then punch holes ARE included in the page's size? 

 

Then what's the reason to move pages apart / to separate spreads? 

 

Or am I really 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

Hi @lfcorullon , Also, this works for me:

 

var doc = app.activeDocument;
var sp = app.activeWindow.activeSpread;
var np = doc.spreads[sp.index+1].pages[0]
var p1 = sp.pages[1];
sp.allowPageShuffle = false;
p1.move(LocationOptions.BEFORE , np);

 

Screen Shot.pngScreen Shot 1.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

Very nice @rob day! I really tried to do a simpler way, but didn't quite manage it. 🙂

- 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
Enthusiast ,
Jul 10, 2024 Jul 10, 2024

Copy link to clipboard

Copied

Great. Will all the problems of trim, bleed, etc be avoided using this option?

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