3 Replies Latest reply on Feb 10, 2010 12:05 PM by Harbs.

    AdjustLayout script error

    Fred Goldman Level 3

      I am often getting an error when I try to use the AdjustLayout script I decided to investigate and it turns it the problem is with these lines 117-120:

       

          var myStartPage = app.activeDocument.pages.item(myStartPageName);
          var myEndPage = app.activeDocument.pages.item(myEndPageName);
          //Set page numbering to absolute
          app.generalPreferences.pageNumbering = PageNumberingOptions.absolute;

       

      Apparently, when setting to absolute numbeing it makes the variables that previously pointed to valid pages invalid. Does anyone know of any workarounds to this?

       

      Just to be clear I get the error when I have the document start on an even number and it does not have Automatic Page Numbering selected.

        • 1. Re: AdjustLayout script error
          AdobeScripts Level 3

          Fred Goldman wrote:

           

          I am often getting an error when I try to use the AdjustLayout script I decided to investigate and it turns it the problem is with these lines 117-120:

           

              var myStartPage = app.activeDocument.pages.item(myStartPageName);
              var myEndPage = app.activeDocument.pages.item(myEndPageName);
              //Set page numbering to absolute
              app.generalPreferences.pageNumbering = PageNumberingOptions.absolute;

           

          Apparently, when setting to absolute numbeing it makes the variables that previously pointed to valid pages invalid. Does anyone know of any workarounds to this?

          You need to read and store documentOffset value for both pages - then you can use it later to get reference to the same physical page.

           

          robin

          www.adobescripts.com

          • 2. Re: AdjustLayout script error
            Fred Goldman Level 3

            Perfect!

             

            Thanks you. Someone should tell Ole so that he can fix it for CS5..

            • 3. Re: AdjustLayout script error
              Harbs. Level 6

              Hi Fred,

               

              This is a common problem which pops up in various cases. You can use 

              getElements()[0] to resolve the object to the id based one...

               

              Harbs

              1 person found this helpful