Word has a nice feature that lets you select some text and press Shift+F3 to cycle between all the available capitalization modes: so you cycle through the options like this:
cycle > Cycle > CYCLE > cycle
just by pressing Shift+F3.
What’s also nice in Word is that it is not necessary to select the whole word – it’s enough to place the cursor somewhere inside the word and press F3 and the capitalization of the whole word is changed.
This all may sound rather minor, but in practice, especially if editing a long piece, it streamlines a repetitive process.
InDesign also has capitalization options: select some text, go to the Type menu, point to Change Case, and there you’ll see the four options InDesign provides: UPPERCASE, lowercase, Title Case, and Sentence case (sentence case just capitalizes the first word in a sentence).
What InDesign lacks, though, is any way of cycling through those cases. Of course it would be possible to assign four different keyboard shortcuts to the four different options, but who wants to remember 4 separate key combinations for something so trivial? A single keyboard shortcut the cycles through all the possible options is much more convenient.
So the following script attempt to mimick Word’s “cycle case” functionality. To use, select some text, or place your cursor inside a word, and run the script. Got the capitalization you’re looking for? Good. If not, run the script again. To truly emulate Word, assign a keyboard shortcut to the script, and you’ve got yourself an InDesign Case Cycle script!
Incidentally, this script is a revision of a popular little script I published a few years ago. In this revised version, InDesign’s Sentence Case option has been added to the script as well.
PS In fact, although the idea behind the script is trivial, the implementation is a little involved, as you can see. There are 2 main difficulties: (1) To get a handle on the word that is adjacent to the cursor, if no text is selected, and (2) to make sure that every time the script is run, something happens to the capitalization, because otherwise the script could get stuck.
For instance, if there is only one word selected, there may be no difference between InDesign’s sentence case and InDesign’s title case. And since the script goes from sentence case to title case, nothing will actually happen, meaning that the script would get stuck on sentence case. Hence the rather convoluted switch statement above!
Well, I hope this little script is useful for you. If you use it, please leave some feedback below! Thanks.