Build Index Text for PDF
by T.L. Ford (www.Cattail.Nu)

This is an automated way to build an index for a book based on terms you provide.

Download the files.

build_index_text_for_pdf.zip

Read the instructions. Work through them step by step. (screenshots below)

Create an empty folder.

It does not have to be called empty_folder.

Copy in your files.

Make a copy - do not work with originals.
This example is using a story by my friend - Triangle Synapse 2085 by Jake Barrett.

Edit the list of index terms (indexTerms.txt).

This example only has a few randomly chosen words.

Get and install SplitPDF.workflow.

SplitPDF.workflow.
There's a download file at the bottom, after the instructions.
Put it in your ~/Library/Services folder.

Run SplitPDF on your PDF.

Right-click in Finder, go to Services, Split PDF.

Run Terminal. Change to directory. Make script executable.

Run the script (in Terminal).

Wait until it is done.
Do not do anything while the script is running.
The initial part where it creates text files for each page PDF is a bit slow (2-3 seconds per page - you can calculate how long you have to get your coffee), but at least you can watch it copy/save.

Finished

The script is done running when you see the new command line.

Check your new index.txt.

Use this text in your project, adjust the formatting.