Skip to main content
Participant
January 25, 2021
Answered

How to automatically number pages 1a, 1b, 2a, 2b, etc?

  • January 25, 2021
  • 10 replies
  • 2375 views

I have used the section/prefix trick in order to accomplish this - I change the prefix to the number and make the style as a, b, c, d... The problem is I have a nearly 400 page document that I need numbered in this fashion. Every 2 pages will need a new prefix, and that is just exhausting editing the page numbers one by one. Is there a more streamlined way to accomplish this?

Correct answer Sunil Yadav

With this snippet, this can be done:

 

var myDoc = app.documents[0];
var c = 0;
while(c < myDoc.spreads.length){
    c++;
    try{
        var sec = app.activeDocument.sections.add(myDoc.spreads[c-1].pages[0]);
        sec.continueNumbering = true;
        }
    catch(e){
        var sec = myDoc.spreads[c-1].pages[0].appliedSection;
        }
    sec.sectionPrefix = c.toString();
    sec.pageNumberStyle = PageNumberStyle.LOWER_LETTERS;
    }

 

 

Sunil


Try this one will perfectly do the work:

 

var myDoc = app.documents[0];
var c = 0;
var index = 1;
while(c < myDoc.pages.length){
    try{
        var sec = myDoc.sections.add(myDoc.pages[c]);
        }
    catch(e){
        var sec = myDoc.pages[c].appliedSection;
        }
    sec.continueNumbering = false;
    sec.pageNumberStart = 1;
    sec.sectionPrefix = (index).toString();
    sec.pageNumberStyle = PageNumberStyle.LOWER_LETTERS;
    c = c+2;
    index++;
    }

 

 

Sunil

10 replies

Sunil Yadav
Legend
February 9, 2021

This kind of query has already been solution. You might want to check it.

https://community.adobe.com/t5/indesign/how-to-have-page-numbers-progress-1a-1b-1c-2a-2b-2c/td-p/10812739

 

Sunil

BreannePAuthor
Participant
February 9, 2021

Yes, I am currently using this solution. But as I explained in my original post this solution is more of a workaround, and I'm looking for a solution that is more automated. I have 12 400+ page documents in which every two pages requires a new prefix (1a 1b 2a 2b 3a 3b etc.). Manually changing the page number ever two pages is not only exhausting, but leaving room for far too much error.

Peter Kahrel
Community Expert
Community Expert
February 9, 2021

The section prefix trick can be scripted. If you ask Sunil he'll do it for you 🙂