Site logo

Scripts for making hyperlinks

Recently I have been working on a set of scripts for making hyperlinks in great numbers: in average 10,000—30,000 per document. The documents are old books converted from Quark, recreated from pdf-files, sometimes simply scanned, OCRed and created anew in InDesign. They have indexes (usually an index to names and an index to dramatic works, performances, movies, etc.), endnotes, comments and footnotes which were made without using the InDesign´s “index” or “footnote” features. Eventually the documents are exported to interactive PDF, ePub, DPS and HTML for posting on a web-site.

After a few months of work, I came up with a solution that works for me well so I decided to post some of the scripts with detailed explanation on my site. Most probably you will not be able to use them as they are, but with even basic knowledge of scripting you will be able to adjust them to your needs. In my opinion, it´s simply impossible to create a script that would work for everybody because all books are too different, but I am going to expound the approach that I use. I think this may come in handy for many InDesign users who have to merge together the two so different worlds: printed publishing and ePub/HTML.

I had to work with many different books and adjust scripts for every particular publication. However the approach used in all scripts is the same. I am going to post a few samples with scripts. You can open a sample document and run a script to see the result. If you´re interested, feel free to rework it to your needs.

Note: the test documents used here as samples are dummies filled with meaningless text; that´s why running the scripts against them results in a great number of not found names, missing pages, etc. With real documents it works OK. Samples are provided as indd-files (version CC) and idml-files. The fonts used are either system fonts (e.g. Times New Roman) , or fonts that come with InDesign (e.g. Minion Pro).

Here is a brief description of the process illustrated with screenshots (Example 1)

Example 2

Example 3

Below are some other scripts used in the workflow.

“Label main text frames” script

“Expand main text frames to the bottom of page” script

Make hyperlinks from Excel — a custom script for making hyperlinks in InDesign using Excel workbooks as a data source.