Script to remove current page number 2

I have a standard page that uses the InDesign "Current Page number" function

I need a script that can subtract current page number 2 - so if the InDesign document opens as a page 5 the script randomly this number 3:

currentpagenumbercs3.PNG

Hi runew,

you want the beginning of the document with a different page number?

Hi love,

InDesign CS3 has no startPageNumber with documentPreferences property.

Example for CS3 (the screenshot shows InDesign CS3):

Document starts with page number 5.

You want to start with the number 3 on the page.

Code for this:

// Number to decrement:
var nDecrement = 2;

// pageNumberStart for a section is only valid, when continueNumbering is set to false
app.documents[0].sections[0].continueNumbering = false;
var myCurrentNumber = app.documents[0].sections[0].pageNumberStart;

if(myCurrentNumber>nDecrement+1)
{
    app.documents[0].sections[0].pageNumberStart = myCurrentNumber - nDecrement
};

If there is more than one section in the document, you must add the code.

See the discription of DOM for CS3 and other versions of InDesign here:

InDesign JavaScript help

Uwe

Tags: InDesign

Similar Questions

  • with the master page "insert current page number" error when you export the book

    Using InDesign CS for Windows 5.5

    Recently updated for InDesign CS (very old one from 2003). I save a copy of all my old files version and kept the old installed ID just in case (after reading all the horror stories on here).

    In my old version of ID, I created a book consisting of some 70 documents. Some of these documents are a single page, while others have multiple pages. In the multiple documents page, I used the "insert... current page number" character (or whatever the command was in the old version) on a page master and formatted as follows, for example: Page 1 of 17, Page 2 of 17, Page 3 of 17, etc. When I exported my book in pdf format, it worked fine. (I is not have to / want page numbers consecutive throughout the book, only in individual documents.) By that I mean my whole book is about 280 pages, but not all of these 280 pages are numbered, only groups of pages in multi-page documents. It is not read page 1-280).

    Am my upgrade to 5.5 a few months ago added some documents in the book, and (if I remember correctly) when I saved the book he asked to convert each document version to the new version, I said OK. When I exported the book in pdf format, some documents that are more than 2 pages are now counted wrong; the numbers are now like this: Page 1 of 17, Page 2 of 17, Page 2 of 17 (supposed to be page 3), Page 2 of 17 (supposed to be page 4), etc. Each page, but page 1 is now page 2 of that either.

    If I open the individual document and export it to PDF, the page numbers work very well. It is only when the document is exported with the book the page numbers to spoil. And it's not all documents in my book; This error starts to a particular document and continues from there throughout the rest of the book, affecting any document more than 2 pages. Documents several pages before that point in the book for export with the correct page numbers.

    I create new documents by performing a "save under" with a previously created document and cut and paste as needed, so I won't have to reformat or implement the page numbers on each new document. I use layers or styles (I do not know there is a better way to do what I need, but I didn't have time to learn the basics, just enough to be functional.)

    My attempts to resolve this problem so far (using version 5.5), tests with the first document where the error: (1) I have removed the document from the book, removed the page number character current insert, back to the current page number character insert, saved, the individual document exported in pdf format and it worked fine. Put it in the book, save, export, and it is bad. (2) I picked up the book document, export the document to .idml, registered as a new .indd new name, exported to PDF and it worked fine. Put it in the book, save, export, and it is bad. (3) I started to the top of my old version of ID, open from the previous version of this document, exported .inx, closed, open the .inx in ID 5.5, registered as a new .indd new name, exported to PDF and it worked fine. Put it in the book, save, export, and it is bad. (4) I moved the document to the top in the order book, put it on a document which correctly numbered pages, saved, exported to PDF and this document was still evil, but one who has been numbered correctly all along is still correct. (5) I compared the settings for this document to others that the number properly and found no difference.

    It's as if the page numbers get hooked on "2" when I export the book, but only in the last two-thirds of the book. Sorry this is so long, but I hope that this description of my problem is understandable. Any advice, other than to go back to my old version documents and start over?

    Thank you for your time and all the information great this forum provides.

    Alice

    Normally, I would say that this kind of problem is symptomatic of the incorrect numbering options in the book panel or an individual document or a bad update of the numbering, and those things are still definitely worth looking at.

    That said, I invite you to go to the original files, export each one to .inx and open those in CS5.5 and save as a new file .indd CS5.5 whose new name, then add them to a whole new book CS5.5. Books are pretty flakey without mixture in the conversion of files, and there are enough bad behvior file conversion directly inherited the .inx route is insurance a little success.

  • INDD: Previous and current Page number in Master Pages.

    Hello

    I try to set the previous page and the current page number next to each other on each plate on the front of each plank. I want to add this in master pages.


    I have attached a picture of what I'm wanting - but for the moment it will only show the same number twice (even though I specified previous and current).

    Screenshot 2016-03-14 10.48.19.png

    Is there a way to do this?

    Thank you.

    There is a way to do that including InDesignSecrets.com Anne-Marie Concepcion. The problem is a little more complicated that you might expect:

    http://InDesignSecrets.com/PreviousNext-page-number-on-same-page.php

  • The previous/next Page number is showing that the current page number

    I'm trying pages numbers with previous Page number and the current Page number, then it is and shows that reason 002-003, but for some they are both appearing as the number of courses, so 003-003. The same thing happens if I try to insert the next Page number.

    I have this set up in the master page in a document issued in March and it works great - when I add new pages they are automatically numbered correctly. However, in a new document, or if I add a new text box to my old document, the Page number previous shows that the current Page number.

    Any idea of what is the cause? I use the latest InDesign on a Mac with os x 10.11.12. My colleague is having the same problem on his Windows PC.

    I am waiting to start a conversation with Technical Support, so I'll post the results.

    Hey Willi

    Thanks for your reply, we are both halfway there, it isn't fair for the lines break...

    I just checked my old document and there was a block of empty text hidden under something else on the previous page, which is linked to the image on the next page that holds page numbers. I need to insert a Page break at the beginning of the first text box to force the numbers on the following page. Now my second text box displays the previous and current page numbers.

    Problem solved!

  • Using the current Page number in IF Condition

    Hello

    I have a requirement to insert a blank page if the last page in the group number is odd, then I'll try to use the syntax below, but its does not work:

    <? If: page-mod number 2! = 0 ? >

    < xsl: attribute name = "break-after" > page < / xsl: attribute >

    <? end if? >

    The number of pages in my report is 5 and if I put 5 instead of the page number in the code above, the blank page is inserted, but it seems that this page number is not acknowledged in the IF condition, and if I put <? fo:page - number? > instead of page number in the if condition, I get an error.

    How can I write an if condition based on the current page number?

    Thank you

    Patrick

    Try using the below command

    Have a condition before you group items

    -jump - number of pages F

    EmpNo

    Ename

    F EMPNO

    ENAME E

    E

    same-jump-number of pages---> contains


    When you want to manage the deletion of the pages of the total number of pages

    You can use the following command in the form same-jump-number of pages field-->

    Thank you

    If this allows you then, please check the answer "correct" or even "useful."

  • I want to put the previous issue of the page and the current page number in a single ex page.  6 / 7

    I want to put the previous issue of the page and the current page number in a single ex page.  6 / 7

    Hello

    Is that what you want?

  • How to remove a page number for a specific page

    I am editing a book of poetry in pages and my start of document with a title page, followed by a couple of blank pages, followed by the table of contents pages followed by the rest of the book pages.  Now I have whole page numbering upwards in the foot with the option of "not visible on the first page.

    My problem is, I want to delete the page number of these blank pages after the title page, but keep the numbering goes after that. However, if I try to delete the page number in the footer of specific, it removes all the footer later (or alternate footers.)

    So my title page is number 1, but some like "poster is not on the first page" it does not show the number, that works.  Page 2 and 3 are empty then 4 page is the first page of table of contents, etc..  I want to make pages 2 and 3 show not the foot of page/number, but keep page 4 and beyond.

    Thanks in advance!

    You did not have the Pages you use. I'll assume Pages 5.x

    Click on the last page you want to have no Page number > Menu > insert > Section break

    Click in the next Section > toolbar > Document > Section > Page numbers > start: 1 > numbering > uncheck continue from the previous section

    If there is a Page number in the previous Section, remove it.

    Peter

  • Can't get "current page number" to generate numbers. He puts just a letter "A" on each page

    I'm all new to indesign. This is an awkward question to ask because it is clearly user error and every tutorial I've looked at suggests it is an easy task.

    I am trying to generate page numbers on an epub multiple page, but when I select the master page, type > insert special characters > markers > current page numbers he puts the letter 'A' on each page instead of their numbering. What I am doing wrong?

    Yes, the answer is as embarrassing easy as I suspected. You should double click on each page to actually view this page. I gave only the pages one click. #winning

  • Under Type menu - Insert a special character - markers - current Page number in the text frame on the Master Page gives the letter A and also a horizontal black line the width of the text box.   This line is not a rule.  Turn on the Wellin gives another l

    Is anyone out there?

    I found the problem.  It was a rule after all.  I didn't the insertion point to the right place.  Everything is OK now.

  • How to display the current page and the total number of pages for a group

    Hi all
    I have a requirement to indicate the current page number and the total number of pages for a group. For example:

    < A >
    < 1 >
    Row1
    row2
    ....
    Clotilde
    < / 1 >
    < 2 >
    Row1
    row2
    ....
    Clotilde
    < / 2 >
    < 3 >
    Row1
    row2
    ....
    Clotilde
    < / 3 >
    < /A >

    Now my requirement is Group 1 can have lines going into several pages say x, so I need to show with in the Group 1 x and on the next page page 1 page 2 x etc.
    Although Group 2 spans several pages, I need to see page 1 of y... etc.

    Can someone help me please how to do this?


    Thank you
    Sunny

    Try if@section

  • How to display the number of current page to formcalc?

    I have a client that will not allow JavaScript in their forms for security reasons.  I am trying to convert the JS, I'm used to working with FormCalc instead, but I don't have much experience with the CF and I am stuck at the first hurdle.

    I want to display the current and total pages in the master page and I changed the code generated to use FormCalc and modified to use the reference to the dollar, but the form is not make the current page number.

    Here is the code

    return. #pageSet [0]. Restricted.CurrentPageNumber::ready:layout - (FormCalc, client)

    Does not work, even if it is copied from the reference material

    this.rawValue = xfa.layout.page ($)

    also tried

    $ = xfa.layout.page ($)


    return. #pageSet [0]. Restricted.NumberofPages::ready:layout - (FormCalc, client)

    Work

    this.rawValue = xfa.layout.pageCount)

    Any help would be really appreciated

    Hello

    to get the current page, you can use the index of your master page ("Restricted").

    $ = $. parent.index + 1

    and for the total number of pages, use

    $ = $layout.pageCount)

  • set in docs book and indicate the current page of the marker number

    I have a book with multiple documents.  There are places in documents that I'll have to do State throughout the book (I'll call him these portions of the text 'X') with the mention "see page __."  I would like to put a marker in 'X' that contains the page number current of 'X '.  I would like to point out that the page number as variable as well as the position of 'X' Exchange, 'see page _' page number reference exchange as the position of 'X' is moving around I have add and subtract documents and text inside the book.

    I know that I can put "current page number" at the marker for 'X', but I do not know how to set the reference 'see page _' so she keeps track of the number of current page of 'X '.  That put the emptiness of "see page _ '?

    Help!  and thank you!

    Marilyn

    > they seem to only work as part of an index.

    Not since CS4. They are pretty well hidden in the help files.

    Look here: http://help.adobe.com/en_US/InDesign/6.0/WS9AD9A0DA-E10F-4d1e-9EB2-999FB61D21E8.html

  • Mathematical calculation with the numbering of the current page

    Hello

    I am currently in a situation where I need 2 types of page numbers for a single page.

    delete.jpg

    To the right side, I use the current page number marker.

    Is there a way to make a mathematical calculation with number of current page on the left side?

    Something like 460 + current page number

    I can't use the data merge feature because all the page are already installed on.

    Kind regards.

    Hello

    You can 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;
                   }
              }
    

    that should work assuming management texts related with the pageNumbers are substituted (accessible)

    Jarek

  • How to get the page number

    Sorry, but again I question. I want to select table by ID, where ID should be equal to the current page number. How can I get the page number?

    Davyd

    Try

    where ID = v('APP_PAGE_ID')
    

    Jeff

  • Reset the page number for the new RTF (not group data) section

    I am working on a set of maritime documents - Pick and Pack Slip briefs. RTF model has 2 sections for the same group of data (delivery). The waybill is a customer oriented document and sheet of choice is used in the warehouse to fulfill the order. The intention is to print the slip to pick and pack slip together, while the selector may include the packing slip in the package that is shipped. I want that each air waybill to start its page number to 1, but it always starts at the current page number - i.e. If the pick slip is 2 pages long, the leaf pack starts at 3. I tried to use the page number of the RTF/MS Word formatting, but it doesn't seem to work? Is there a way to reset the page number for a new RTF section?

    Can I store the current page number in a variable and use a formula to reset the page number for the waybill?

    Please note: this is not a <? for-each@section:tag? > question.

    Thank you
    Sunder

    That's the one. Let me know if you encounter a question on this

Maybe you are looking for

  • HP 2309v - settings won't save!

    Hello I have problems with the HP 2309v monitor that I bought today. Well, I changed several times the brightness/contrast/sharpness etc how I want, however, whenever my computer goes to sleep, or when I turn off the screen, settings are deleted and

  • Re: Satellite C660D - cooling system of the fault

    Hello I get a message on my cell, read, defect detected in the cooling system immediately turn off the power and claim a satellite service. It is not the fan I had the I.T. guys at work, take a look. It seems the front of the laptop, where is the car

  • I can't Siri to answer a phone call

    I can't Siri or Siri Hey to answer a phone call?  I have a Rav Toyota aged 12 years who doesn't have bluetooth or hands free capability, and I don't like to use a bluetooth headset while driving.

  • NVIDIA graphics confg on Satellite A300 - 1-5

    Hello I use a laptop Toshiba Satellite A300 - 1 5 and I want to install games, I want to know wheather this system got confg graphics from NVIDIA.or let me know how to install the same?

  • RX100 firmware update to improve the system of AEB

    Hello It would be absolutely perfect if the RX100 was better exposure auto bracketing system, that allows to make more than 3 exposures (5 or 7 would be good) at intervals between each shot EV 2 or 3 EV. He did a very limited AEB system, which allows