how to automatically apply A & B master pages consecutively...


more specifically, want automatically apply & b master pages consecutively document across of it's pages.

 

i found bit of code in sample scripts , figured out how apply b master single page (page 3 in case)

 

var mydocument = app.activedocument;
var mypage = mydocument.pages.item(2);


 

mypage.appliedmaster = mydocument.masterspreads.item("b-master");

 

 

but i'm totally stumped how proceed.


i figure need function find out how many pages in document, , apply b master each next page until reaches end.

so example document 6 pages long, when create has master applied pages, a, a, a, a, a, a

but want go a, b, a, b, a, b.
easy enough task manually know 6 pages handy on longer documents.....


any appreciated, i'm new , trying figure out how few useful things

thanks!

hi...

 

i created apply alternative master pages document using left , right option.. try this

 

 

 

var d = app.documents[0]; var mydialog = app.dialogs.add ({name:"apply masterpage",cancancel:true}); var allmasters = new array; (i=0; i<app.activedocument.masterspreads.length; i++)   allmasters.push(app.activedocument.masterspreads[i].name);   (mydialog) {   (dialogcolumns.add())   {    (dialogrows.add())   {   statictexts.add ({staticlabel:"left   "});   myleft = dropdowns.add ({stringlist:allmasters, selectedindex:0});   }   (dialogrows.add())   {   statictexts.add ({staticlabel:"right"});   myright = dropdowns.add ({stringlist:allmasters, selectedindex:0});   }   } } if (mydialog.show() == true) { for(var p=0;p<d.pages.length;p++){      //looking right hand pages:       if(d.pages[p].side == pagesideoptions.right_hand){           d.pages[p].appliedmaster = d.masterspreads.item(allmasters[myright.selectedindex])         };          if(d.pages[p].side == pagesideoptions.left_hand){           d.pages[p].appliedmaster = d.masterspreads.item(allmasters[myleft.selectedindex])           }        } } 


More discussions in InDesign Scripting


adobe

Comments

Popular posts from this blog

Soustraire une selection

After Effects: could not find dvaeve_dialogs.txt

Illustrator cs6 "Invalid Serial Number"