#NoEnv SetWorkingDir %A_ScriptDir% SendMode Input #InstallKeybdHook #UseHook On (:: if GetKeyState("ScrollLock","T") { sel := GetSelection(1) if sel PasteText("(" sel ")") else Send (){Left} sel := "" } else Send ( Return ":: if GetKeyState("ScrollLock","T") { sel := GetSelection(1) if sel PasteText("""" sel """") else Send ""{Left} sel := "" } else Send " Return {:: if GetKeyState("ScrollLock","T") { sel := GetSelection(1) if sel PasteText("{" sel "}") else Send {{}{}}{Left} sel := "" } else SendRaw { Return [:: if GetKeyState("ScrollLock","T") { sel := GetSelection(1) if sel PasteText("[" sel "]") else Send []{Left} sel := "" } else Send [ Return GetSelection(wait = "") { ClipBack := ClipboardAll Clipboard := "" Send ^c if wait ClipWait 0.05 Selection := Clipboard Clipboard := ClipBack Return Selection } PasteText(text) { ClipBack := ClipboardAll Clipboard := "" sleep 10 Clipboard := text ClipWait 1 SendInput ^v sleep 10 Clipboard := ClipBack Return }