Macro to insert hyphens between string of words in MS Word (ie if selected in Word)

Is there a way to insert hyphens between a string of words in Word or other applications? tx

Try this:

Hyphenate Selected Text.kmmacros (20 KB)

Macro screenshot

3 Likes

Thanks. I just saw this.

I found an AppleScript that does this too:

Sub HyphenateSelection()
Dim rng As Range
Set rng = Selection.Range
rng.Text = Replace(rng.Text, " ", "-")
End Sub

1 Like

By the way, this app is great for these sorts of general-purpose text transformations: GitHub - amebalabs/Esse: Swiss army knife of text transformation for iOS and macOS

It provides a command line tool /Applications/Esse.app/Contents/MacOS/EsseCommandLine, so it can be scripted by KM.