Link to home
Start Free TrialLog in
Avatar of oaktrees
oaktrees

asked on

Autohotkey Script for Capitalization of Selected Text

Need an Autohotkey script that will work for Title Case capitalization, and reverse of selected text.

Found this, but can't seem to get it to work.

Nor any way for it to EXCLUDE a set of words like "the", to", "and", "from", "for".

I quickly solved the retyping problem:

+^k:: ; SHIFT+CTRL+K converts text to capitalized
  Clipboard := ""
  SendInput, ^c ;copies selected text
  ClipWait
  StringUpper Clipboard, Clipboard, T ; Title mode conversion
  SendInput %Clipboard%
Return
This Hotkey mostly fixes the all-caps text by converting every word to initial caps. However, I did need to revert some prepositions and connectors to lowercase as appropriate (e.g. And ⇒ and, For ⇒ for, To ⇒ to, etc)

What do you think is happening?

Many thanks!!

OT
ASKER CERTIFIED SOLUTION
Avatar of Joe Winograd
Joe Winograd
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of oaktrees
oaktrees

ASKER

Dunno what I was doing but it IS working now! :))))))))))))))))))))

Thanks, Joe!
Hi OT,
You're welcome...and thanks back at you for writing the Testimonial...much appreciated! I'm very glad to hear that it's working now for you.

Regarding the ability to exclude words from the capitalization, I decided that is worthy of an enhanced AutoHotkey script and an EE article on it. Here's the link:

Exclude words when converting to "Title Case" - AutoHotkey Script

Please let me know how that works for you. Regards, Joe