Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
- ; #Warn ; Enable warnings to assist with detecting common errors.
- SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
- SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
- ; Uppercase/Lowercase text converter
- ~CapsLock::
- ; Save clipboard
- ClipSaved := Clipboard
- ; Clear clipboard
- Clipboard :=
- ; Copy selected text (if available)
- Send, ^c
- Sleep, 100
- If (Clipboard == "") ; There are no selected texts
- {
- ; If clipsaved is not null
- if (ClipSaved != "") {
- ; return the clipboard
- Clipboard := ClipSaved
- ; handle clipboard
- If Getkeystate("Capslock", "T") ; Convert text to upper
- {
- StringUpper Clipboard, Clipboard
- ToolTip, Converted Clipboard to upper
- }
- else ; Convert text to lower
- {
- StringLower Clipboard, Clipboard
- ToolTip, Converted Clipboard to lower
- }
- } else {
- ToolTip, There are no texts to convert in the Clipboard.
- Sleep, 1000
- }
- Sleep, 1000
- ToolTip
- }
- else ; The texts selected is available to convert
- {
- If Getkeystate("Capslock", "T") ; Convert text to upper
- {
- StringUpper Clipboard, Clipboard
- Send %Clipboard%
- }
- else ; Convert text to lower
- {
- StringLower Clipboard, Clipboard
- Send %Clipboard%
- }
- }
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement