Copy link to clipboard
Copied
Hi,
Currently I am in situation where I need 2 types of page numbers for one single page.
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.
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;
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Hi,
Sorry for the delay in responding. But your script did just what I wanted.
Thank you so much.
Regards
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more