InDesign's Title Case function changes a selection's capitalisation to title case. The trouble is that all words in the selection are converted to initial case. This is wrong: you want The Adventures of a Troubled Soul, not The Adventures Of A Troubled Soul. At the same time, if words like a and the follow a colon or a period, they should be capitalised: Columbus: An Adventurous Soul.
The script, title_case.jsx, comes with a list of words, titlecase_exceptions.txt. This list contains words that in English texts should not appear with an initial capital. You can add and/or replace words to your own taste. If you do change the list, use a plain-text editor.
Like most of its formatting functions, InDesign's title case function can be applied only to some selected text. But as selecting text is a tedious activity, and since applying title case in long bibliographies is one of the most mind-numbing things you can do, the script can often be used without making text selections. Details follow.
The script has no interface. It has six modes:
1. Place the cursor in some italic text, run the script: only the current italic text is title-cased. No need to select text: just place the cursor somewhere in some italic text and run the script.
2. Place the cursor inside some text in quotation marks, run the script: only the text inside the quotes is affected. The script first checks if there's a quotation mark somewhere to the left and a matching closing one somewhere to the right. If titles are in single quotes there is some scope for error if the title also includes apostrophies, so you need to keep your eyes open. Again: no need to select text, just click somewhere inside some quoted text.
3. If the insertion point is not italic and if it's not in quotation marks, then the script applies to the whole paragraph.
4. If what you want to title-case can't be defined by italics or quotes, and if you don't want to title-case the whole current paragraph, you'll have to resort to the good old selection method: select some text, then run the script.
5. The fifth mode affects all italic text in a story. To use this mode, select a text frame and run the script. The text frame's parent story is processed, not just the frame's contents.
6. With nothing at all selected the script looks for paragraph styles that have title style in their name and applies title case to all text to which those styles were applied. This is a quick way to title-case e.g. section headings in a document: temporarily add title style to the style names, run the script, then remove the addition. Or just leave it for future use.
The exception list is a simple text file that lists the words that the script should ignore, each exception on a separate line. When you change the list, be careful not to type any spaces. The list and the script should be stored in the same folder.
10 Sept. 2020: The script used to replace whatever needed to be title-cased, which meant that things like index markers and text anchors were removed. Fixed. Secondly, a sixth mode was added to the script: target the content of certain paragraph styles.
24 June 2017: Paragraph-initial words weren't always converted. Fixed.
1 July 2012: Posted.
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.
Download script: right-click, then select 'Save link as' (or 'Download')
Download exception list (right-click etc.)
Installing and running scripts
Questions, comments? Get in touch