is now part of CreativePro.com!

Making Page Numbers as Words Instead of Numbers

Recently, I came upon a script that is so awesome that I have to share it with you. The question came up:

Is it possible set up automated page numbering where the numbers are actually formatted as words instead of numbers? e.g. ‘Four’ instead of ‘4’

Most of us would simply reply, “No.” But Theunis de Jong (a.k.a. Jongware) took on the challenge and decided to write a script that could do this.

The script works like this: You type a # symbol in a text frame on your master page (that’s a normal # symbol, not a special character):

Wordnum1

Then, go back to your document pages and double-click the script in the Scripts panel.

Wordnum2

More after the jump! Continue reading below
Free and Premium members see fewer ads! Sign up and log-in today.

The script quickly overrides those master page items and changes the # to an actual number, based on the “real” page number. (It only acts on the # symbol when it’s from the master page; it won’t mess up the # symbol when used normally on document pages.) For example, if your document starts on page “1” then it would end up looking like this:

Wordnum3

I have tried this with documents starting on any number (even over a thousand) and it converts to “word numbers” properly. Even better, if your document page numbers later change, you can run the script again and it updates the page numbers!

Download

Sorry, you need to be logged in as a free or paid member of InDesignSecrets to download this file.
David Blatner is the co-founder of the Creative Publishing Network, InDesign Magazine, and the author or co-author of 15 books, including Real World InDesign. His InDesign videos at LinkedIn Learning (Lynda.com) are among the most watched InDesign training in the world. You can find more about David at 63p.com.
  • Jamie McKee says:

    That’s really cool! What languages does the script support?

    • Um… English only, as far as I can tell. If you open the script you may be able to edit it for other languages. However, some languages have very different ways of constructing number words, so it may be difficult to localize this one.

      • guz says:

        I tested it but the number is placed off the page. I placed the text box in the master page centered at the bottom but it comes out off the page towards the spine. Wonder why.

  • moizngp says:

    Sounds very interesting.
    I tried the script on InDesign CC (latest version) on Windows 7 and received following error.

    Error Number: 30614
    Error string: Invalid object for this request.

    Engine: main
    Line: 26
    Source: frame = masterFrame.override(aPage);

  • Page Simon says:

    I am using InDesign CC (version 9.3), and I cannot install the script. The download is a plain white icon with the .jsx. However, it doesn’t unzip, nor will it drag onto the Utilities>Script panel. ??

    • Jongware says:

      @Page: well, it’s a plain .jsx so it does not need unzipping, and that’s the good news. The bad news is you are not SUPPOSED to ‘drag it’ on the Script panel. Please see David’s link to How to install a script.

  • Jongware says:

    Please try to not make it hard for the script to work :P

    guz: check how your rulers are set up: ‘per page’, ‘per spread’ , or ‘on spine’. I *think* the script might mis-place boxes as you describe when the rulers are not ‘per spread’.

    moizngp: unfortunately, not enough information… The error message describes what’s wrong but it cannot tell *why*. For instance, perhaps the objects on the master page are locked? Or, frankly, thousands other possibilities… Try with another document.

    • Carlos Padilla says:

      Is it possible to use the script with a book?

      I understand I have to open each file on the book and run the script, but maybe is possible to chage something to select all the files in the book instead of the active document.

  • Page Simon says:

    Never mind. I downloaded it a second time, and it work perfectly. Nice addition to design tool.

  • Jonathan Paterson says:

    One small correction : in line 79, change “fourty” ti “forty”.

  • Loïc Horellou says:

    Hello, and thanks a lot for this script, I just updated the numberToText function to be able to work with the french way of counting (which is a bit more complicated than the english or spannish way :-/ ) :

    http://jsfiddle.net/lohic/9f9y9z9n/

    • amr says:

      Merci beaucoup pour vos effors , mais ce script ne marche pas avec moi. je travaille via indesign cc. le scipt englich marche bien mais pas le français.

      • [Jongware] says:

        So what does not work? “It doesn’t work” is not a useful debugging report, in any language …

      • LoÌøc Horellou says:

        In the jsfiddle link I just uploaded the numberToText function. This function needs to be replaced in the English script. I did use it several times without any bug.

  • Hi Jongware, knowing you are Dutch, is it easy for you to make a Dutch version?

  • John Ringer says:

    Absolutely brilliant, many thanks Jongware,

  • Audrey says:

    Can change word (WriteOutNumbers.jsx) to lowercase letters instead upper and lowercase letters?

    • Thiago Ribeiro Nogueira says:

      Hi Audrey,

      I think you can open and edit the script. Go to line 33 and change “toUpperCase” to “toLowerCase”.

      Works for me!

  • amr says:

    Merci beaucoup pour vos efforts , mais le script en français ne marche pas .
    je travaille via indesign cc. le scipt englich marche bien mais pas le français.

  • Emilio Lari says:

    Can someone help me translate it in Italian? I’ve done most of the work but there are some exception on how you spell out numbers that I don’t know how to integrate.
    for example all the 2 digit numbers that contain 1 and 8 are spelled slightly different from the other ones (they basically lose the last letter before the unit):
    20= Venti 22= ventidue but 21=ventuno 28=ventotto
    30= Trenta 32= trentadue 31=trentuno 38= trentotto
    and so on for all the numbers till 100 (120=centoventi 121=centoventuno)

  • Cathy Mores says:

    I’m getting an error 5122 when using this script. Says line 26 (frame = masterFrame.override (aPage)) is causing the issue? I’m getting it to work on the first 20 pages or so of the document, but doesn’t work all the way through, whether the master page has been overridden or not.

  • Jared Shapiro says:

    This is a great script! I put it to good use; however I’ve come across an error along the way. “5122: The master page item is already overridden on the page.” Now it won’t update new pages–only pages already laid out. I thought it might be that I accidentally put two #’s on a page, or had one overlapping another, but that doesn’t seem to be it. Error source: line 26 “frame = masterFrame.override (aPage);”

    Oh, I see Cathy Mores above is having the same issue. Mine worked to page 39.

    Help?

    • Jared Shapiro says:

      I think I got somewhere, but I don’t know why it worked: I deleted the text box with the # sign on the first page it stopped working, and then reapplied the master to the page. It fixed the rest in sequence.

  • >