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

Help with indesign script

New Here ,
Jan 09, 2017 Jan 09, 2017

Hello everybody I need help and I am sure somebody will have an answer to it. I need to print large an indesign document that has hundreds of pages, however I need to print a color spread every 8 pages to function as a separator. Now instead of manually enter the spread manually every 8 pages I would like to know if there is a way to do this automatically, maybe a script, this would really help.

677
Translate
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

Guide , Jan 09, 2017 Jan 09, 2017

Hi

copy/paste the code into a code editor.

I recommend you use Adobe ExtendScript Toolkit.

Then save and name the script file in javascript format here : [...]Adobe InDesign\Scripts\Scripts Panel.

Finally, in Indesign, choose Window > Utilities > Scripts.

Double-click or right-click to execute the script.

That's it.

The script above inserts a new page, based on a Master page, every 8 pages.

Further explanation for Line 15 :

for(var i=6;i<=doc.pages.length;i+=8){

i=6 means script will start including new

...
Translate
Guide ,
Jan 09, 2017 Jan 09, 2017

Hi

maybe something like this might help :

var doc = app.documents[0];

var masterNames = doc.masterSpreads.everyItem().name;

var d = app.dialogs.add({name:"pick a master spread"});

d.dialogColumns.add().staticTexts.add({staticLabel:"Master Pages:"});

var dd = d.dialogColumns.add().dropdowns.add({stringList:masterNames});

if(d.show()){

     var index = dd.selectedIndex;

     d.destroy();

} else {

     d.destroy();exit();

}

var master = doc.masterSpreads.item(index);

for(var i=6;i<=doc.pages.length;i+=8){

     doc.pages.add(LocationOptions.AFTER,doc.pages,{appliedMaster:master});

     };

Based on https://forums.adobe.com/message/3223771#3223771#3223771

Translate
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
New Here ,
Jan 09, 2017 Jan 09, 2017

Hey thanks for your fast answer, I am very new to scripts and in fact I have no idea how to make one out of what you wrote, can you please tell me how to make one with the code you sent?

Translate
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
Guide ,
Jan 09, 2017 Jan 09, 2017

Hi

copy/paste the code into a code editor.

I recommend you use Adobe ExtendScript Toolkit.

Then save and name the script file in javascript format here : [...]Adobe InDesign\Scripts\Scripts Panel.

Finally, in Indesign, choose Window > Utilities > Scripts.

Double-click or right-click to execute the script.

That's it.

The script above inserts a new page, based on a Master page, every 8 pages.

Further explanation for Line 15 :

for(var i=6;i<=doc.pages.length;i+=8){

i=6 means script will start including new page AFTER page 7 (looks strange but note that javascripts starts counting at... 0!)

i+=8 means it will repeat the operation every 8 pages. So the result here will be pages 8, 16, 24, 32... will be inserted.

Understanding that, you might have to modify the code, depending on how you want it to act.

Hope that helps

Vinny

Please note there is a specific indesign scripting forum here: InDesign Scripting

Translate
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
New Here ,
Jan 09, 2017 Jan 09, 2017
LATEST

Awesome! this solved it, you just help me save a lot of work! thank you very much!

Translate
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