Tt
Convert selection to title case

Script key: Convert selection to title case

Posted by Drew B.

Install

Details

Label Tt
Voice Over Convert selection to title case
Script
// Script keys run short Javascripts
// For documentation and examples, visit:
// http://help.agiletortoise.com

function toTitleCase(str)
{
    return str.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});
}

setSelectedText(toTitleCase(getSelectedText()));

Advanced

Keyboard shortcut None
Hide key Yes

Discussion

comments powered by Disqus