Line Numbering
Did you ever wish InDesign had the ability to number your lines? Well now it does with a little script!
“Number Lines by Style” is a script which allows you to add line numbers to text of specific styles. I works by adding anchored text frames at the start of each line. The script will number lines on the current page only.
“Number Lines by Style” was written in its original form for Koren Publishers we thank them for their consent to share it!
Please download the script from here.
Usage
- Place the script in your Scripts Panel folder
- Make sure the correct page is active
- Double click on the script in the Scripts Panel
- Select the style or styles to number and click OK.
Examples of Use
Here we have a shopping list of the most important things that you could possibly need.

We want to number the list items, so we run the script, and select the Numbered Lines paragraph style:

Which numbers our items:

Of course the example is kind of silly, because we can just use paragraph numbers. The one situation similar to this, where you might want to use this script, is when you’d need the numbers outside the text frame.
A more classic example would be a sitaution where you’d need every line numbered, and the paragraphs are more than one line long:

In this case, you’d run the script and select all the styles used in the essay:

Presto! numbered lines:

- The script uses an object style for the anchored text frames, as well as a paragraph style for the numbers within the frame. You can adjust these styles to tweak the positioning and formatting of the numbers.
Have fun!
Posted: March 1st, 2010 under Scripts.
Tags: InDesign, Scripts
Comments
Comment from Harbs
March 1, 2010 at 7:07 pm
We’ve just uploaded version 1.0.1 which fixes a couple of bugs found by Caleb Clauset. (Thanks Caleb!)
Pingback from perasalvino.es – » Numerar lineas de un estilo
March 2, 2010 at 9:29 am
[...] El script se puede bajar de la web de in-tools.com. [...]
Comment from Pierre Labbe
March 14, 2010 at 1:26 pm
It’s very cool.
Can I talk about this script in a French blog?
Comment from Mohamed Yehia
March 19, 2010 at 3:16 pm
very cool but it is numbering an empty line, I don’t like this way, on other hand I’m very happy to download this script I hope to find my idea come true.
this script must have some more options making us control the way numbering and start number value.
Comment from Harbs
March 20, 2010 at 5:11 pm
@ Pierre: No problem!
@ Mohamed: Great ideas! We’ll try to add those when we get a chance.
Comment from mitch
April 19, 2010 at 7:35 pm
Thanks for this – is there any way to reverse it though? As in, I need line numbers in one version of the document that will go to a committee for revision, but I need to remove them before publication.
Thanks in advance!
Comment from Harbs
April 20, 2010 at 1:54 am
You could do a search/replace to remove anchor markers if there’s no other markers in your story
Comment from Mike
May 10, 2010 at 10:26 am
Seems it cannot see styles list in CS5 – the script window is empty
Comment from Harbs
May 10, 2010 at 11:39 am
Hmm.
I haven’t yet tried in CS5. I’ll try to check it out…
Comment from Harbs
May 10, 2010 at 3:04 pm
I just tested in CS5, and it seems to work correctly.
Is it possible that the current page has no text?
It only displays paragraph styles which appear on the current page.
Comment from webdesign
July 29, 2010 at 8:28 am
Keep on the good job! It’s very cool.
Comment from Webdesign Breda
August 7, 2010 at 5:56 am
Hey Harbs, thanks for this little nifty script! I’ve got InDesign CS5 though and it doesn’t seem to work with this version. Am I doing something wrong here? Some of the pages don’t have any text yet. Could that be it?
Comment from Harbs
August 8, 2010 at 3:10 am
In what way does it not work?
Is there some kind of error?
Comment from JoeVan
August 17, 2010 at 10:38 am
Any chance you have the option to start the numbering at a particular number? Thanks for the useful script.
Comment from frasta
August 28, 2010 at 3:37 pm
Paragraph styles used in grouped objects (e.g., figure grouped with figure caption) do not appear in the Para styles list. At least in CS4. Otherwise great, have been looking for such a script for a long time.
Comment from KC
August 28, 2010 at 10:06 pm
I just tried this and it is great. One thing though I can’t get the numbers to flow onto the next page. I created a style just for line numbers and it still doesn’t work. Any suggestions?
Comment from Harbs
August 29, 2010 at 1:41 am
@franza: Good point about nested objects. Nested object introduces considerable complexity — especially in regard to the numbering sequence. I’ll have to think about this…
Comment from Harbs
August 29, 2010 at 1:41 am
@KC: The script works page-by-page. What are you trying to do exactly?

RSS
Pingback from InDesignSecrets » Blog Archive » Quickly Add Line Numbers With This Free Script
March 1, 2010 at 10:48 am
[...] can read more and download the script from this page on In-Tools [...]