I wound up buying TextSoap, as things like this are tedious in KM. I’m learning it would be easier for me to write a Ruby (sed, etc) script as figure out how to do it in Keyboard Maestro. Edit: TextSoap is easy to call from PopClip too.
Thanks so much KC, this is enough for me to learn some more. It works if you start with a string with spaces, but it doesn't convert between each type of case (e.g. Camel Case => Kebab Case => String with spaces).
Also strangely it conflicts with Alfred (launcher) causing the Alfred search bar to appear when one of the macros are run. More research for me.
@froamer - Understood. I've modified the macros so that you can ctrl-z (undo) the selection if you don't like the case you selected. I kept the macros separated as you requested.
So if you make the selection "a string with space", you select your chosen case. If you don't like it, control-z and hot key the one you want. Make sense?
As for your Alfred, problem. There may be a conflict hotkey. Make sure you change the hotkey , that I've selected, to suit your own. For example, the hotkey control-shift-option-command-9 to control-option-command 9 or whatever you chose.
Great macros thank you!
I have been working on something like this for a while with another twist:
using like in MS Word ⇧F3 to cycle the selection to lowercase, UPPERCASE, Title Case, Sentence case.
This could be further refined by using a RegEx to evaluate the string and if lowercase start the cycle with Title Case etc, if UPPERCASE start with lowercase etc.