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

Inserting pages into a large Document

Community Beginner ,
Feb 28, 2022 Feb 28, 2022

Copy link to clipboard

Copied

I have a 5000 page document that I need to insert a blank page every 5 pages. Are there any scripts available for this?

 

TOPICS
How to , Scripting

Views

133

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 , Feb 28, 2022 Feb 28, 2022

Have done similar variations of this before. Here you go. 

 

var pgs = app.activeDocument.pages;
var i = 4;
while (true) {
    try {
        pgs.add(LocationOptions.AFTER, pgs[i], {appliedMaster:null});
        i+=6;
    } catch(e) {
        break; //we're out of range
    }
}

 

Votes

Translate

Translate
Community Expert ,
Feb 28, 2022 Feb 28, 2022

Copy link to clipboard

Copied

LATEST

Have done similar variations of this before. Here you go. 

 

var pgs = app.activeDocument.pages;
var i = 4;
while (true) {
    try {
        pgs.add(LocationOptions.AFTER, pgs[i], {appliedMaster:null});
        i+=6;
    } catch(e) {
        break; //we're out of range
    }
}

 

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