4 Replies Latest reply on Aug 8, 2011 7:04 AM by John Hawkinson

    irregular automatic page numbering

    jo_ana_33

      hello everyone,

       

      I was wondering if such a thing exist : i want to number the pages of my book regularly (1,2,3,4,5....) but with a variation each 4. That is :

       

      "titel : 01" page 1

      "die titel : 02" page 2

      "die die verdammte titel: 03" : page 3

      " die die die titel : 04" : page 4

       

      and then back again

       

      "titel : 05" page 5

      "die titel : 06" page 6

      "die die verdammte titel: 07" : page 7

      " die die die titel : 08" : page 8

       

       

      is something like that possible with InDesign CS2 ?

       

      thank you very much !

       

      j

        • 1. Re: irregular automatic page numbering
          [Jongware] Most Valuable Participant

          jo_ana_33 wrote:

           

          is something like that possible with InDesign CS2 ?

           

          Absolutely (but InDesign will not do it automatically, if that was what you were hoping for).

           

          Look in the Pages panel, under "Sections & Numbering".

          • 2. Re: irregular automatic page numbering
            John Hawkinson Level 5

            I'm quite confused, since it looks like the desire is to number pages 1,2,3,4 and then 5,6,7,8, and that is...the way pages are normally numbered. From the Subject line, I thought it was going to be a desire for 1,2,3,4,1,2,3,4 or 1,1,2,2,3,3,4,4 or something. Am I misreading things?

             

            Anyhow, Jongware, I also would have expected a 3-line script! I was thinking about supplying one until I realized I had no idea what the question was!

            • 3. Re: irregular automatic page numbering
              Peter Spier Most Valuable Participant (Moderator)

              Looked to me like the OP wanted some sort of running pattern for a prefix.

              • 4. Re: irregular automatic page numbering
                John Hawkinson Level 5

                Looked to me like the OP wanted some sort of running pattern for a prefix.

                Oh, I see.

                 

                Unfortunately prefixes are limited to 5 characters, so that's not really going to work.

                Here's a proof of concept though:

                 

                var
                    d = app.activeDocument, prefix,
                    //prefixes= [ "titel : ", "die titel : ",  "die die verdammte titel: " , " die die die titel : "],
                    prefixes = ["t", "dt", "ddvt", "dddt"],
                    i;
                    
                for (i=0; i<d.pages.length; i++) {
                    prefix = prefixes[i%prefixes.length];
                    if (parseInt(d.pages[i].name,10) <10) { prefix = prefix+"0"; }
                    d.sections.add(d.pages[i],  { sectionPrefix: prefix } );
                }
                

                 

                a bit more than 3 lines, alas.