2 Replies Latest reply on Jun 13, 2008 6:24 PM by (Dave_Saunders)

    Master Applied to Added Page

    Level 1
      If I do this:

      myDoc = app.documents[0];

      a page is added to the end of myDoc.

      Question: is the master spread applied to that new page always the same as the master applied to the previous last page? Or is it a crap-shoot and I should apply that master?

      I suppose all I have to do is:

      myDoc.pages[-1].appliedMaster = myDoc.pages[-2].appliedMaster;

      but it seems a waste if it's always going to do that for me.
        • 1. Re: Master Applied to Added Page
          [Jongware] Most Valuable Participant
          In the UI at least, a new page uses the same master as the previous one.

          ... although I'd stick to setting the master explicitly, so you know what's going on next time you look at the script. It hardly seems worth the trouble, compared to fussing about if it suddenly
          i stops
          working ...

          Any specific reason you don't use "app.documents[0].pages.add()"? That has a documented parameter "reference" -- "Required when the at parameter value specifies before or after. Can accept: Page, Spread, MasterSpread or Document. (Optional)"
          Using "pagesPerDocument++" on document preferences sounds a bit ... you know ... lateral thinking.
          • 2. Re: Master Applied to Added Page
            Level 1
            It just seemed simple enough to do it that way, so I did.

            Sometimes, I just like to explore parts of the object model to see what's there and then try it out to see if it actually does what it seems to do.

            Thanks for the input.