2 Replies Latest reply on Oct 24, 2013 10:09 PM by Arihant Jain Mg

    Mathematic Calculation with Current page numbering

    Arihant Jain Mg

      Hi,

       

      Currently I am in situation where I need 2 types of page numbers for one single page.

       

      delete.jpg

       

      For the right side I am using the current page number marker.

      Is there a way to do mathematic calculation with current page number on the left side?

      Something like 460+current page number

       

      I cant use the data merge feature because all the page are already layed out.

       

      Regards.

        • 1. Re: Mathematic Calculation with Current page numbering
          Jump_Over Level 5

          Hi,

           

          You could run a script:

           

          app.findGrepPreferences = null;
          app.findGrepPreferences.findWhat = "~N";
          
          var 
               FindGrep=app.activeDocument.findGrep(),
               len = FindGrep.length, 
               item, pageNo, calcNo, rightSide,
               mDiff = 460;          // edit this value according to needs
          
               while (len-->0) {
                    item = FindGrep[len];
                    pageNo = item.parentTextFrames[0].parentPage.name;
                    calcNo = parseInt(pageNo) + mDiff;
                    item.paragraphs[0].contents = calcNo + "\t" + pageNo;
                    rightSide = item.parentTextFrames[0].textFramePreferences.textColumnFixedWidth;
                    with (item.paragraphs[0]) {
                         tabStops.add({alignment: TabStopAlignment.RIGHT_ALIGN, position: rightSide});
                         justification = Justification.LEFT_ALIGN;
                         }
                    }
          

           

          which should work assuming textFrames with pageNumbers are overridden (accessible)

           

          Jarek

          • 2. Re: Mathematic Calculation with Current page numbering
            Arihant Jain Mg Level 1

            Hi,

             

            Sorry for the delay in responding. But your script did just what I wanted.

             

            Thank you so much.

             

            Regards