Find Master Page A and apply Master Page B
hi,
here's i've written:
var mydoc = app.documents[0]; var mymasterspreads = mydoc.masterspreads; var mypages = mydoc.pages(appliedmaster("a")); for(n=0;n<mypages.length;n++){ mypages[n].appliedmaster = mymasterspreads.itembyname("b"); };
of course, doesn't work [ easy beginner me! ]
thanks in advance debugging it!
close, (unless there's property lists pages master page applied to, don't remember offhand), you'll have loop follows:
var mydoc = app.documents[0]; var mymasterspreads = mydoc.masterspreads; var thespread = mymasterspreads.itembyname("a"); var mypages = mydoc.pages; (n = 0; n < mypages.length; n++){ if (mypages[n].appliedmaster == thespread){ mypages[n].appliedmaster = mymasterspreads.itembyname("b"); }; };
i haven't tested this, general approach...
ariel
More discussions in InDesign Scripting
adobe
Comments
Post a Comment