Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Mathematic Calculation with Current page numbering

Community Beginner ,
Oct 10, 2013 Oct 10, 2013

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.

TOPICS
Scripting
914
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Mentor , Oct 10, 2013 Oct 10, 2013

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;

      

...
Translate
Mentor ,
Oct 10, 2013 Oct 10, 2013

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 24, 2013 Oct 24, 2013
LATEST

Hi,

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

Thank you so much.

Regards

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines