Create index topics from text tags

The script creates topics and page references from text marked with certain tags. You enter the tags in the script's dialog, including, optionally, tags for subtopic separators and sort-order separators. Choose to replace an existing index or to add new topics and page references to an existing index.


The script shows this dialog:

[image: index from tags]

Enter the start and end tags and the tag used for subtopics. If there aren't any subtopics, just leave the field empty. If an entry contains sort-order information, enter the sort-order separator. For instance, an entry like this:

\index{Mathematicians#B. Russell@Russell, B.}

creates a topic Mathematicians with a subtopic B. Russell. And that subtopic's sort-order field will be set to Russell, B.

Sort orders can be specified for all (sub)topic levels. Schematically as follows:


which will end up in InDesign's page references options window as follows:

[image: InDesign's page references window]

Hiding/keeping tags

To keep your tags in the document, tick Keep (and hide) tags. The script creates a character style and applies it to the tags so that they become invisible (by setting the type size to 0.1 points and the horizontal scaling to 1%). The tags can be seen in the story editor.

Version history

26 February 2016: The script needed a fix to improve the handling of sort orders.

18 March 2011: Fixed a problem with consecutive index tags.

3 February 2011: Fixed an odd bug that caused page references to be deleted if the tag was followed by certain punctuation marks. The script now also remembers which tags you used the previous time the script was used.

May 2009: First posted.

Useful script? Saved you lots of time?

Consider making a donation. To make a donation, please press the button below. This is Paypal's payment system; you don't need a Paypal account to use it: you can use several types/brands of credit and debit card.

Peter Kahrel's paypal account

Show script (right click, Save Link/Target As to download)

Back to the main page on indexing

Back to the main script page

Installing and running scripts

Editing a script

Questions, comments? Get in touch