June 24, 2015 at 8:36 PM by Dr. Drang
Earlier this evening, I complained on Twitter about the Caps Lock function on the iOS keyboard.
Typing R.E.S.P.E.C.T. on my iPhone just now reminds me how much I hate iOS’s Caps Lock that doesn’t stay locked through punctuation.
— Dr. Drang (@drdrang) Jun 24 2015 5:41 PM
Merlin Mann pointed out another case transformation problem in iOS:
@drdrang I’d also love a secret mode for doing Title Case.
— Merlin Mann (@hotdogsladies) Jun 24 2015 5:45 PM
I’m sure Merlin would prefer something universal that would work in all apps, but I don’t have that kind of power. I can, however, make a Drafts keyboard extension like Greg’s UPPER and lower extensions.
There is already in the Drafts Action Directory a keyboard extension that says it converts to title case, but it’s too naive. It capitalizes every word, which is not what title case is. Title case is actually kind of complicated. In some styles, titles are capitalized the same way sentences are—that’s what I use here at ANIAT. More common are styles like the one in an answer at the English Language Stack Exchange:
- Always capitalize the first and the last word.
- Capitalize all nouns, pronouns, adjectives, verbs, adverbs, and subordinate conjunctions (“as”, “because”, “although”, “if”, etc.).
- Lowercase all articles, coordinate conjunctions (“and”, “or”, “nor”), and prepositions regardless of length, when they are other than the first or last word. (Note: NIVA prefers to capitalize prepositions of five characters or more [“after”, “among”, “between”].)
- Lowercase the “to” in an infinitive.
John Gruber, back when he still posted scripts at Daring Fireball, wrote an excellent Perl script for converting to title case. A good chunk of it was rewritten by David Gouch and put in a GitHub repository. I mashed David’s script together with a slightly adjusted version of Greg’s UPPER script, and the result was this:
To save you the time and annoyance of copying and pasting the script into Drafts, I’ve posted it to the Drafts Action Directory. Go to this page in Safari on your iPhone or iPad and you’ll see a button that’ll install it directly in Drafts for you. You do have Drafts, don’t you?
Here’s what it looks like on my phone. I have the three case transformation buttons in a little cluster.
You’ll note in David’s script that three of the “little words” that don’t get capitalized are the common conjuctions and, but, and or, so it’s only appropriate that I end with this:
This post is brought to you by your favorite general, General Foods.