Created
June 6, 2017 06:56
-
-
Save xcloudx01/8c1e77c0d0d82a4e225fb00a94c0179f to your computer and use it in GitHub Desktop.
AHK - Convert type case quickly
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;CTL+L - convert to lowercase | |
;CTL+U - convert to uppercase | |
;CTL+K - invert the case (e.g. "The Big Dog" becomes "tHE bIG dOG") | |
;SHIFT+CTL+K - convert to capitalized (e.g. "the big dog" becomes "The Big Dog") | |
;SHIFT+CTL+U - convert to sentence case | |
^u:: ; Convert text to upper | |
sendinput,{CTRLDown}C{CtrlUp} | |
StringUpper Clipboard, Clipboard | |
Sendinput %Clipboard% | |
RETURN | |
^l:: ; Convert text to lower | |
sendinput,{CTRLDown}C{CtrlUp} | |
StringLower Clipboard, Clipboard | |
Sendinput %Clipboard% | |
RETURN | |
+^k:: ; Convert text to capitalized | |
sendinput,{CTRLDown}C{CtrlUp} | |
StringUpper Clipboard, Clipboard, T | |
Sendinput %Clipboard% | |
RETURN | |
^k:: ; Convert text to inverted | |
Lab_Invert_Char_Out:= "" | |
Loop % Strlen(Clipboard) { | |
Lab_Invert_Char:= Substr(Clipboard, A_Index, 1) | |
if Lab_Invert_Char is upper | |
Lab_Invert_Char_Out:= Lab_Invert_Char_Out Chr(Asc(Lab_Invert_Char) + 32) | |
else if Lab_Invert_Char is lower | |
Lab_Invert_Char_Out:= Lab_Invert_Char_Out Chr(Asc(Lab_Invert_Char) - 32) | |
else | |
Lab_Invert_Char_Out:= Lab_Invert_Char_Out Lab_Invert_Char | |
} | |
Sendinput %Lab_Invert_Char_Out% | |
RETURN |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment