Convert between Spaced String, Camel Case, Kebab Case and Snake Case

Thank you!

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.

I do appreciate the help though.

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.

Thanks for all your help! Amazing!

@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.

Here is the new Macro group - version 1.0.2.

Froamer Macros.kmmacros (25.8 KB)

For the record, there are many ways to do this, in KM. This is just one simple way. This can be created with Switch/Cases and loops I suppose.

Try it out and lets us know what you think

KC

Many thanks KC, I'll have a play

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.