BearCode
BearCode

Reputation: 2950

Title Case in AutoHotkey

Is it possible to transform the text in the Clipboard in a Title Case form? For example if the text in the clipboard is "The quick brown fox" then the script will have to transform it into:

"The Quick Brown Fox"

It would be nice to also work with non-ASCII characters too (diacritics), transforming "anders ångström" into "Anders Ångström"

Upvotes: 3

Views: 731

Answers (2)

Christopher
Christopher

Reputation: 2256

Old question but in case anyone else in my boat looking for this or something similar this reddit post got me what I needed:

^!u::
clipboard := ""
send ^{c}
clipWait, 0.3
stringUpper, clipboard, clipboard
send ^{v}
return

^!l::
clipboard := ""
send ^{c}
clipWait, 0.3
stringLower, clipboard, clipboard
send ^{v}
return

^!t::
clipboard := ""
send ^{c}
clipWait, 0.3
stringLower, clipboard, clipboard, T
send ^{v}
return

After setting up holding CTRL+ALT and "l", "u" or "t" will change the case of your selected text.

Upvotes: 0

Robert Ilbrink
Robert Ilbrink

Reputation: 7953

Try this:

StringUpper, ClipBoard , ClipBoard  , T
Send, ^v
Return

Upvotes: 1

Related Questions