Skip to main content
Inspiring
June 7, 2022
Answered

Reshuffling page spreads after creating new page

  • June 7, 2022
  • 2 replies
  • 460 views

I have an 80+ page document using broken apart spreads in the pages window. I want to add a new page after page 13. Once I create the new page, every page after that is no longer on the correct side of the spread. How do I update the pages to automatically re position the pages. I know how to do this manually, but it would be very time intensive. Please see attached image for what I am trying to accomplish. Thanks!

This topic has been closed for replies.
Correct answer DexAlpenglow

For anyone looking for a solution to this, I found a script that I had to modify slightly, but now works great.

The filetype is not supported to upload it to this thread, so here is the code:

/*****************************************************

ReShufflePages.jsx
An InDesign CS2 javascript by Harbs.
For more scripts and automation tools visit www.in-tools.com.

Will separate all pages to allow for inner bleeds
while preserving the original orientation of the page.
Basic testing done on CS2 ME. (Should work with CS and CS3 also, but untested.)
Use at your own risk!!!

*******************************************************/
aDoc = app.activeDocument;
for (i=0;i<aDoc.pages.length;i++){
	aSide = aDoc.pages[i].side;
	aSide = aSide + "";
	aDoc.pages[i].insertLabel("direction",aSide);
	}
aDoc.documentPreferences.allowPageShuffle = true;
aDoc.documentPreferences.facingPages = false;
aDoc.documentPreferences.allowPageShuffle = false;
aDoc.documentPreferences.facingPages = true;

/*skyfire addition*/
justOnce = 'no';
last = 'left';

for (i=0;i<aDoc.pages.length;i++){
	myPage = aDoc.pages[i];
	mySide = myPage.extractLabel("direction");
//alert(mySide);   
    
	if (mySide == "1818653800" && justOnce == 'no'){
		myPage.move(LocationOptions.atEnd,myPage,BindingOptions.leftAlign);
        justOnce = 'yes';
        last = 'left';
		}else{
		
            if (last == 'left') {
        
        myPage.move(LocationOptions.atEnd,myPage,BindingOptions.rightAlign);
                 last = 'right';
                } else {
                    myPage.move(LocationOptions.atEnd,myPage,BindingOptions.leftAlign);
                     last = 'left';
                 }
        
        }
	}

Just save this as a .jsx file.

2 replies

DexAlpenglowAuthorCorrect answer
Inspiring
June 14, 2022

For anyone looking for a solution to this, I found a script that I had to modify slightly, but now works great.

The filetype is not supported to upload it to this thread, so here is the code:

/*****************************************************

ReShufflePages.jsx
An InDesign CS2 javascript by Harbs.
For more scripts and automation tools visit www.in-tools.com.

Will separate all pages to allow for inner bleeds
while preserving the original orientation of the page.
Basic testing done on CS2 ME. (Should work with CS and CS3 also, but untested.)
Use at your own risk!!!

*******************************************************/
aDoc = app.activeDocument;
for (i=0;i<aDoc.pages.length;i++){
	aSide = aDoc.pages[i].side;
	aSide = aSide + "";
	aDoc.pages[i].insertLabel("direction",aSide);
	}
aDoc.documentPreferences.allowPageShuffle = true;
aDoc.documentPreferences.facingPages = false;
aDoc.documentPreferences.allowPageShuffle = false;
aDoc.documentPreferences.facingPages = true;

/*skyfire addition*/
justOnce = 'no';
last = 'left';

for (i=0;i<aDoc.pages.length;i++){
	myPage = aDoc.pages[i];
	mySide = myPage.extractLabel("direction");
//alert(mySide);   
    
	if (mySide == "1818653800" && justOnce == 'no'){
		myPage.move(LocationOptions.atEnd,myPage,BindingOptions.leftAlign);
        justOnce = 'yes';
        last = 'left';
		}else{
		
            if (last == 'left') {
        
        myPage.move(LocationOptions.atEnd,myPage,BindingOptions.rightAlign);
                 last = 'right';
                } else {
                    myPage.move(LocationOptions.atEnd,myPage,BindingOptions.leftAlign);
                     last = 'left';
                 }
        
        }
	}

Just save this as a .jsx file.

Diane Burns
Inspiring
June 7, 2022

Do you have "Allow document pages to shuffle" selected in the pages panel?

Inspiring
June 7, 2022
Yes, it is turned on, still no dice
Scott Falkner
Community Expert
Community Expert
June 8, 2022

It is a poorly named command. You should turn it off to get what you are after. I say it is poorly named because there is a command called “Allow…” something that seems to prohibit something.