Creating a ‘Make Title Case’ Service in Snow Leopard
Inspired by the Services overview on the Mac OS X Automation website (via John Gruber), I decided to take a crack at creating my own system-wide service for converting text to title case – utilizing, of course, John Gruber’s TitleCase script.
I’m not a programmer, and the little programming knowledge I do have is strictly front-end web development, so the thought of setting up a Service like this, where I can easily convert text to title case, was very appealing. Even more appealing was the fact that I could easily show how anyone could do this.
What you need
First, here’s what you need:
- Snow Leopard
- John’s TitleCase.pl script (use option-click in Safari to download, or right-click and “Save as…”)
- About five minutes
Creating the Service
The Mac OS X Automation website has a tutorial on how to create a Service in Snow Leopard, but you really only need to skim the photos to understand the process. Apple’s made it easier than saving 15% on your car insurance.
After downloading the TitleCase script, launch Automator. Choose ‘Service’ in the template manager, and you’ll be presented with an Automator workflow creator window.

Leave “text” and “any application” selected in the building pane, but check the “Replaces selected text” box.
Now search the actions library for “script”, and then drag the “Run Shell Script” action to the workflow pane. It should be the last item in the search results.
Now, open the TitleCase.pl script in a text editor (Text Edit works just fine), and copy the entire script.
Back in Automator, select “/usr/bin/perl” in the Run Shell Script action; in the ‘shell’ drop down menu. Select the entire sample print script that shows up, and delete it. Now paste the TitleCase.pl script.
Save (File > Save), title, and enjoy! Your new Service will be saved in the “Text” category of the Keyboard Shortcuts Preference Pane. From there you can assign a global keyboard shortcut.
Update: John points to a new version of his script by Aristotle Pagaltzis, which, he says, is ‘better in every way’. (Thanks to Jordan Yee for the tip in the comments below.)
This rocks.
I’m waiting for Smashing Magazine or someone to host the “Top 20 Most Useful Service Scripts” soon… services = amazing.
§ Jesse J. Anderson · 28 August 2009
The new Services menu is awesome. I’ve already created a ton of new Services along these lines using Python.
§ Carl · 07 September 2009
This new Services functionality is seriously tempting me to buy the Snow Leopard upgrade.
§ Bryce · 07 September 2009
Great article, thanks – before now I’d overlooked all the Services praise as hype. After seeing how useful this is, I’m off to watch the PixelCorps videos on automation.
§ Alex Muller · 07 September 2009
Why copy and paste the contents of the Perl script into the Automator workflow, instead of just calling it?
§ Michael Barber · 07 September 2009
Michael – so you don’t have to keep the file hanging around.
§ Jesse J. Anderson · 07 September 2009
I’ve tried this exactly as is but when I run it it just deletes the text. Any ideas what I might be doing wrong?
§ Thomas Fitzgerald · 07 September 2009
Thomas, it happened to me as well, using Aristotle Pagaltzis’ improved code solved the problem for me. You can find the link to it in John’s script.
§ Travis Lupin · 07 September 2009
What is title case?
§ Slim · 07 September 2009
Travis – Cool, that worked! Thanks
§ Thomas Fitzgerald · 07 September 2009
Excellent!
Slim – Title Case is the First Letter of Every Word Capitalized Except for Words Like ‘a’, ‘the’, ‘an’, etc…
§ Michael · 08 September 2009
ha ha very happy..that worked for me too…
§ sachin · 08 September 2009
Very smooth! About time we had a good user-level use for powerful scripting languages on the Mac.
§ Goldarn · 08 September 2009
The only thing this script doesn’t do is title case items that are already in all capital letters. Anyone have a recommendation as to how to tweak the perl script?
§ Lon Seidman · 08 September 2009
Quite timely. Just today I re-read Chapter 7 of Joe Zobkiw’s book “Mac OS X – Advanced Development Techniques” which shows how to change text to upper case, lower case, or capitals. However, the book came out in 2003, so the approach was certainly more Cocoa-centric, since Automator wasn’t even around yet.
§ Chad · 08 September 2009
Works great in text apps, but why doesn’t this show up in Word?
§ brett · 11 September 2009
Thanks for the nice little guide. FYI though, John Gruber has pointed out that “[Aristotle Pagaltzis’] result is better than my original script in every way.”
Here’s a link to Pagaltzis’ script home if you want to update this page.
http://plasmasturm.org/code/titlecase/
§ Jordan Yee · 23 May 2010
Works great, I’ve been looking for a way to do that. I’m beginning to see the possibilities of using services.
§ Mr Price · 03 February 2011
yeah word doesnt seem to work very well – the service doesnt even show up. perhaps im not performing the action correctly. Tried it in stickies but it encountered an error.
§ Bruce Bell · 05 February 2011
The new Services menu is awesome. I’ve already created a ton of new Services along these lines using Python.
§ HGH · 19 February 2011
Hey great stuff, thank you for sharing this useful information and i will let know my friends as well.
§ mothers day flowers delivery Mexico City · 29 April 2011
I really loved reading your blog. It was very well authored and easy to understand. Unlike additional blogs I have read which are really not tht good. I also found your posts very interesting. In fact after reading, I had to go show it to my friend and he enjoyed it as well!
>
§ MD Toyota · 29 April 2011
Manually Deleting Apps Device Will Improve the iPhone 4 Cases. The answer’s a huge YES. I proceeded to shut each app (and at any time you have a tonne of apps youll notice how many are really frozen state) after which you resumed iMovie. The visible difference was literally all the time. I surely could peruse through my media within iMovie with out lag at all.
§ iPhone 4 Cases · 02 May 2011
So informative things are provided here,I really happy to read this post,I was just imagine about it and you provided me the correct information I really bookmark it,for further reading,So thanks for sharing the information.
saint-petersburg hotels
§ aint-petersburg hotels · 03 May 2011
Apple always make everything easier, I noticed that after I have changed my PC to Mac. Even here, with writing scripts, obviously I’m not so much into that but I don’t need to be a developer or anybody else to understand you guideline. Thanks.
§ essay writer · 05 May 2011
The post is written in very a good manner and it entails many useful information for me. I am happy to find your distinguished way of writing the post. Now you make it easy for me to understand and implement the concept. Thank you for the post
§ review · 09 May 2011
I think one of your commercials triggered my internet browser to resize, you may well want to put that on your blacklist.
§ flowers delivery st petersburg · 09 May 2011
. Even here, with writing scripts, obviously I’m not so much into that but I don’t need to be a developer or anybody else to understand you guideline. Thanks for sharing and i really like this post .
§ Break Up Messages · 10 May 2011
nd enjoy! Your new Service will be saved in the “Text” category of the Keyboard Shortcuts Preference Pane. From there you can assign a global keyboard shortcu.polo outlet
§ soccer cleats · 11 May 2011
The new Services menu is awesome. I’ve already created a ton of new Services along these lines using Python.
college essay help
§ erik · 12 May 2011
Thank you for such a fantastic blog. Where else could anyone get that kind of info written in such a perfect way? I have a presentation that I am presently working on, and I have been on the look out for such information, and I many Thank to you.
cell spy software
§ kalbern joy · 12 May 2011
colocation server hosting offers its clients the advantages of security and facility of dedicated server
§ Ans1210 · 18 May 2011
Is it possible to apply this script for Automator to batch rename selected Finder items? I can’t quite figure out how to do that.
§ Octavian · 22 May 2011