This TextExpander action implements of John Gruber’s approach to Title Case in Javascript.
To use as a TextExpander action, simply copy and paste the code as-is into the editor when creating a new Javascript action.
Copy the text you want to titlecase and then call the snippet.