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
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?
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);
Copy link to clipboard
Copied
Very nice @rob day! I really tried to do a simpler way, but didn't quite manage it. 🙂
- Mark
Copy link to clipboard
Copied
Great. Will all the problems of trim, bleed, etc be avoided using this option?