3 Replies Latest reply on Dec 11, 2009 3:40 AM by Harbs.

    Find the last page is verso or recto

    Techi Panda Level 2

      Hi scripters

       

      here I am tryin to find the document ends in verso page or recto page here is my step

       

      lastPage = app.activeDocument.pages.length-1;
      alert(lastPage);

       

      how I can math the lastPage is verso or recto

       

      thanks in advance

       

      regards

      a r u l

        • 1. Re: Find the last page is verso or recto
          Loic.Aigon Adobe Community Professional

          Hi Arul,

           

          First of all, you approach may not return what you want.

           

          lastPage = app.activeDocument.pages.length-1;

           

          is only returning the length of pages in the document minus 1. So if you have 12 pages, it will return 11 and not a reference to the last page.

          If you want so, you have to ask for :

           

          lastPage = app.activeDocument.pages[-1];

           

          Once said, why don't you have a look in the Indesign object model ?

           

          Pages :

           

          Page.side  (Read Only)
          Data Type: PageSideOptions
          The side of the binding spine on which to place the page within the spread.

           

          Loic

          • 2. Re: Find the last page is verso or recto
            [Jongware] Most Valuable Participant

            Its index will be odd for even pages, even for odd pages.

            You don't even have to check the "last" page; if the document length is odd, the last page is a verso. If the document length is even, the last page is a recto. Of course, this assumes you started with a regular (verso) page.

            • 3. Re: Find the last page is verso or recto
              Harbs. Level 6

              You should always use the side property.

               

              The index of the page (or documentOffset) is not always a good 

              indication.

               

              Examples:

              right bound documents

              spreads with more than (or less than) 2 pages.

              Spreads which are set to not shuffle can be either recto or verso.

               

              Harbs