Title Case

InDesign applies title case indiscriminately. The script lets you define words that should be ignored. In addition, the script can often be used without selecting text: it recognises the state...

This script is part of the Type and Text collection. See the full collection here

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.

Use

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

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.


Version history

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.


Peter Kahrel Script Repository
Hosted as a community service, and with deep appreciation, by CreativePro.com


Scripts by Topic | Script Index
Basic Script Installation and Use
How to Modify or Configure These Scripts
Resources for Scripting and Publishing Automation
About This Repository


Repository Home Page


Contact Peter Kahrel


Note to users: You run scripts at your own risk: CreativePro and the author accept no liability for anything that may be caused by any of these scripts. Always take the necessary precautions. We encourage you to save backups and test scripts on copies of your documents.

Bookmark
Please login to bookmark Close

This article was last modified on August 22, 2026

Comments (0)

Leave a Reply

Your email address will not be published. Required fields are marked *

Loading comments...