I came looking how to convert case like I do in QuicKeys. I am getting down to the point of macros that I haven't quite figured out yet after a year of converting QuicKeys macros to Keyboard Maestro and Chris that is one of them.
The options in QuicKeys seem much more user friendly and what I can find in Keyboard Maestro seems more like a programers mind to figure out what is going to happen and what to change. See how intuitive (at least to me) the macros are for this in QuicKeys.
Others have pointed out the filter actions, but basically what you're running up against is a difference in philosophy between Quickeys and Keyboard Maestro.
With Keyboard Maestro, rather than give you a tool that operates on file names in the Finder, I give you three different tools, one to iterate through the Finder selection, one to change the case and once to rename a file, and you put them together like lego blocks.
So yes, if what you are doing fits exactly in to what has been provided natively, the Quickeys approach can be simpler. But as soon as you want to do something slightly different, then you have to do it in an entirely different way, or maybe it is not possible at all.
With Keyboard Maestro, if you want to change the case of all the lines in a variable, the same process applies. Or if you want to rename the files in a different way, the same process applies - you just adjust the part that has changed to match your new requirements.
And yes, that can be a jarring change from what you are used to, but it can also open up whole new things you can do that you could not before, and while it may appear more complicated initially, plugging together several less complicated facilities keeps things simpler as you expand the scope of what you want to do.
Very nice thank you all, I figured Keyboard Maestro had it in there somewhere I just wasn't able to find it after searching.
Thank you for the included macro.
I needed to tweak your very helpful macro post to not have the case change be included in my clipboard history. The funny thing is I found another post you had posted in my search to not botch the system clipboard and the "title case" macro was posted in the forum talking about how to restore clipboard history by copying it first to a temp and then restoring it.
Strange coincidence the same macro also talked about what I wanted to do to the macro.
No doubt, the very nice thing about flexibily comes a degree of complexity and slightly steeper learning curve. I would love to see someone put together a series of tutorials for Keyboard Maestro though I do like what "Asian Efficiency" has done with what he knows on YouTube.
Before:
what in the WOW is going On
After:
what in the wow is going on – lower case
What in the WOW is Going On – Lower Case First
WHAT IN THE WOW IS GOING ON – UPPER CASE
What in the WOW is going On – Upper Case First
What In The Wow Is Going On – Capitalize
What in the WOW Is Going on - Title Case
What in the Wow Is Going on – Title Case With Running Lower Casing First
I'll have to work out the missing building block in Keyboard Maestro that changes all the selected items in the Finder to convert the case (it didn't near instentaneously even in El Capitan) since this just does it for selected text rather than selected items in the Finder like I had it before. Much more universally useful though as pointed out by Peter.
That is very helpful to know, thanks for pointing me to the read about clipboards and the mandate to go through the system clipboard.
Understood, I guess all I was saying is I'll have to put that on my bucket list to figure out how it is done in Keyboard Maestro. Could use straight up AppleScript I guess. Left that last comment in here for kicks and laughes because I just read your third post that has the AppleScript! Thanks so much Chris, you are outstanding!
That is interesting and even shorter though I am trying to wrap my head around "Past Clipboard 0" instead of 1. I guess that just means the last thing that was in the clipboard. Played around a bit with that removing and adding that action and it goes through the history of the clipboard. I guess that is all retained by Keyboard Maestro and no the system.
WordService provides a large number of commands for working with selected text:
Reformat text paragraphs
Clean up tabs, quotes, line endings
Remove unwanted text parts
Sort lines or paragraphs Change case
Shift paragraphs right or left
Obscure using Rotate 13
Insert date, time, or file path
Get text statistics
You're welcome, Once you install the WordService, then you can assign shortcut keys to each service function (System Preferences > Keyboard > Shortcuts), which you can then obviously call from a KM Macro.
PastClipboard 1 really is the first available past clipboard.
PastClipboard 0 is a synonym for the current system clipboard.
My macro above actually puts two items in the clipboard, so I have to pop both of them off the stack to get back to the original current clipboard item.
I installed that too. I tried DevonThink Pro Office for a while and since it was too propirtary in storying all of its files and they were still working out the syncing details between computers I stopped using it. They do make some pretty cool software though no doubt.
Interesting the system clipboard retains a history, I didn't realize that, I thought you needed 3rd party apps to do that. Seems like remove PastClipboard 1 and PastClipboard 0 would result in the same outcome. Thanks for the info, good to learn new tricks.
Does anyone know how I can only Title Case the first word of a given string? I want to make a macro that will turn a string in my clipboard into a sentence.
So if my clipboard holds this is a cat, after I run a macro I paste This is cat. text. So the first word is title cased and a dot is added in the end.
I am not sure how I can title case only the first word and then add the dot in the end. Should I use python for this?
Based on your example, when you say title case here, it sounds like you just mean "make the first letter of the first word in the string uppercase." Assuming that is indeed the case, this can easily be done in KM with an Uppercase First filter and a regex search-and-replace: