6 Replies Latest reply on Feb 15, 2014 12:02 AM by garethirwin1234

    Applying masters to certain pages

    garethirwin1234 Level 1

      Hello, sorry if this question is confusing!

       

      Basically I use books mostly. I use the contents page as my master document and all other docs sync with that.

       

      What I would like to achieve is a variety of background faded images for each page. The way I thought achieve this was to say have 10 images which get applied in rotation to each page of the documents in the book.

       

      I was gussing I could do this somehow with master pages but wondered if there was a way to make indeisgn apply the master to the document pages in rotation? I do not mind if it restarts for each document in the book if that would make it easier?

        • 1. Re: Applying masters to certain pages
          Javed_ali Adobe Employee

          There isnt such an option in InDesign but what you can try accomplishing the same using Javascript of InDesign where you can apply a master page in rotation to all the pages of InDesign.

           

          -Javed

          • 2. Re: Applying masters to certain pages
            garethirwin1234 Level 1

            Thanks Javed.

             

            I think javescript is a bit beyond my capabilities. I'll continue manually doing it!

            • 3. Re: Applying masters to certain pages
              Javed_ali Adobe Employee

              j=3 //change 3 to number of master spreads and then run

               

              for(i=1;i<=app.activeDocument.pages.length;i++)

              {

                  switch(i%j)

                  {

                  case 0:

                        app.activeDocument.pages.item(i-1).appliedMaster = app.activeDocument.masterSpreads.item(0);

                        break;

                  case 1:

                        app.activeDocument.pages.item(i-1).appliedMaster = app.activeDocument.masterSpreads.item(1);

                        break;

                  case 2:

                        app.activeDocument.pages.item(i-1).appliedMaster = app.activeDocument.masterSpreads.item(2);

                        break;

                       

                  }

              }

               

              You can try running this script in InDesign this should do most of the work for you. This works on the currently active document.

              • 4. Re: Applying masters to certain pages
                [Jongware] Most Valuable Participant

                You can also try this little Javascript -- it's essentially the same as Mohammed's, but it uses the page number as base for which master page to pick and so it will not restart with the first master page at each new document.

                 

                Note that it relies on the page numbering being set to digits. It will not work if you somewhere used roman numerals or (abc). Also, make sure all of your masters are in all of your documents.

                 

                for (i=0; i<app.activeDocument.pages.length; i++)
                {
                app.activeDocument.pages[i].appliedMaster = app.activeDocument.masterSpreads[((Number(app.activeDocument.pages[0].name)-1+i) % app.activeDocument.masterSpreads.length)];
                }
                
                • 5. Re: Applying masters to certain pages
                  Laubender Adobe Community Professional & MVP

                  Jongware wrote:

                  Note that it relies on the page numbering being set to digits. It will not work if you somewhere used roman numerals or (abc).

                   

                  @Jongware – we can overcome this little hurdle, if we use "documentOffset" instead of "name":

                   

                  for (i=0; i<app.activeDocument.pages.length; i++){
                      app.activeDocument.pages[i].appliedMaster = app.activeDocument.masterSpreads
                          [
                              (
                                  (
                                      Number(app.activeDocument.pages[0].documentOffset
                                      )+i
                                  ) 
                                      % app.activeDocument.masterSpreads.length
                               )
                          ];
                      };
                  

                   

                  Uwe

                  • 6. Re: Applying masters to certain pages
                    garethirwin1234 Level 1

                    Wow thanks for this guys. All I have to do is learn what to do with it and we will be set