script to add separators
Learn / Forums / InDesign Add-ons (Scripts, Scripting, and Plug-ins) / script to add separators
- This topic has 3 replies, 3 voices, and was last updated 6 years, 9 months ago by PMB Dessktop/Prepress.
-
AuthorPosts
-
-
January 9, 2017 at 2:52 am #91076Miguel LluesmaMember
Hello 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.
-
January 9, 2017 at 9:27 am #91082Kai RübsamenMember
Miguel, this seems to be possible, but you should also care of the applied masterpage and if the pages are paginated, those color spreads must be excluded from the count > every 8 pages a new section is needed.
Kai
-
January 17, 2017 at 7:05 am #91311Miguel LluesmaMember
Hello Kai
thanks for your answer, a person over in the adobe forums gave me this script which solved the problem and one can adjust it to add separators every number of pages etc. It works and it save me a lot of work: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=3;i<=doc.pages.length;i+=8){
doc.pages.add(LocationOptions.AFTER,doc.pages[i],{appliedMaster:master});
}; -
July 2, 2017 at 5:34 am #95797PMB Dessktop/PrepressMember
Hello forum!
Can someone help me add a drop down list for odd or even pages to this existing script?
I can modify it so it will create new pages “BEFORE” doc.pages but I would like to have the two options in one script…… not two separate scripts.Thanks for any help in advance!
MPBvar 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=doc.pages.length-1;i>=0;i–){
doc.pages.add(LocationOptions.AFTER,doc.pages[i],{appliedMaster:master});
}
-
-
AuthorPosts
- You must be logged in to reply to this topic.