-
-
Save davebrny/7712575122bbed789416ca4800391621 to your computer and use it in GitHub Desktop.
!u::goSub, set_upper_case | |
!l::goSub, set_lower_case | |
!t::goSub, set_title_case | |
set_upper_case: | |
set_lower_case: | |
set_title_case: | |
revert_clipboard := clipboardAll | |
clipboard = | |
send ^{c} | |
clipWait, 0.3 | |
if (a_thisLabel = "set_upper_case") | |
stringUpper, clipboard, clipboard | |
else if (a_thisLabel = "set_lower_case") | |
stringLower, clipboard, clipboard | |
else if (a_thisLabel = "set_title_case") | |
stringLower, clipboard, clipboard, T | |
send ^{v} | |
sleep 50 | |
clipboard := revert_clipboard | |
return | |
/* | |
[script info] | |
version = 1.2 | |
description = change the case of selected text | |
author = davebrny | |
source = | |
*/ |
Agreed. A reverse case option would be very handy.
Hi again, I´ve found a Sript that does what we wanted!
here: https://www.autohotkey.com/board/topic/70940-trying-to-help-a-friend-but-now-im-stumped/
SetKeyDelay 100 ; For clipboard operations
Mode = 0
!u::
ClipSave:= Clipboard
NewText:= Clipboard:= ""
SendEvent ^c ; Copies what is selected
If !Clipboard ; if nothing is selected
Goto Out
Mode:= (Mode>4)? 0 : Mode+1
If Mode = 1 ; iNVERTED cASE
NewText:= RegExReplace(Clipboard,"([^a-z]+)|([^A-Z]+)","$L1$U2")
If Mode = 2 ; Sentence case
NewText:= RegExReplace(Clipboard,"(\w)([^?.:!]*)","$U1$L2")
If Mode = 3
StringUpper NewText, Clipboard ; UPPER CASE
If Mode = 4
StringLower NewText, Clipboard ; lower case
If Mode = 5
StringUpper NewText, Clipboard, T ; Title Case
ToolTip % SubStr(NewText,1,200)
Out:
Clipboard:= ClipSave
Return
~*Alt up::
If Mode = 0
Exit
Clipboard:= NewText
SendEvent ^v
Clipboard:= ClipSave
Mode = 0
ToolTip
Return
Perfect. Thanks. :-)
Hi! thank you for the Script, but could be added a keystroke to Toggle the Case, I mean, if you have "hELLO HOW ARE YOU rALPH" selected, to convert it in "Hello how are you Ralph",
thank you!