macOS, Text – Tools to Transform Text to All Caps or Lowercase

macostext;

Is there a system-wide text manipulation app that enables you to select text and convert all letters to upper case or lower case, like a code text editor would?

Best Answer

You can set this up as a right click service in automator as @Matthieu Riegler suggested.

Open up Automator.app and create a “Service” with this workflow.

enter image description here

Pay close attention to the checkbox up top, “Output replaces selected test”. After the workflow is in place and saved, navigate to “System Preferences-->Keyboard.” On the left hand side select “Services”. On the right hand side you will see the Service you created, in the example its saved as “UpperCase”. Then give it a shortcut by pressing “Add Shortcut” and give it what you would like. Tested in TestWrangler and TextEdit.

Script used in Automator:

on run {input, parameters}
set upperCaseString to ¬
    (do shell script ("echo " & input & " | tr a-z A-Z;"))
return upperCaseString
end run