Change Text Case With AppleScript

Last night, I was looking for a quick way to change a string of text from lowercase to Title Case, which is the format I use for headlines here at MacStories. Normally, I would recommend installing WordService by DEVONtechnologies, but that’s a system Service, and I don’t seem to be able to install those without logging out and back in (I didn’t want to log out).

As I’ve come to learn lately, when you’re looking for ways to automate your Mac, the solution has likely already been posted on MacScripter. Among all the possible combinations of AppleScript to change text to a particular case format, I like this one by forum member “kai”. Essentially, the script takes the someText property and transforms its text items through changeCase to four possible options: upper, lower, title, and sentence.

To customize the script to my needs, I set someText to get the contents of my clipboard, change the case, then turn the result over to the clipboard again. In this way, I can select any text, copy it (so the original version is available in ClipMenu’s history), change the case, and paste back. To run AppleScripts with a keyboard shortcut, I use either Keyboard Maestro or Alfred.

Check out the AppleScript here.

Access Extra Content and Perks

Founded in 2015, Club MacStories has delivered exclusive content every week for nearly a decade.

What started with weekly and monthly email newsletters has blossomed into a family of memberships designed every MacStories fan.

Learn more here and from our Club FAQs.

Club MacStories: Weekly and monthly newsletters via email and the web that are brimming with apps, tips, automation workflows, longform writing, early access to the MacStories Unwind podcast, periodic giveaways, and more;

Club MacStories+: Everything that Club MacStories offers, plus an active Discord community, advanced search and custom RSS features for exploring the Club’s entire back catalog, bonus columns, and dozens of app discounts;

Club Premier: All of the above and AppStories+, an extended version of our flagship podcast that’s delivered early, ad-free, and in high-bitrate audio.