How to make AHK to type braces (curly brackets) Topic is solved
How to make AHK to type braces (curly brackets)
A simple question, and probably answered several times already, but the answer seems hard to find. I want AHK to type a text that includes the braces { and }, which AHK normally uses to define blocks. How to do that? Thanks for your help!
Re: How to make AHK to type braces (curly brackets)
Wrap them in {}
Or use SendRaw to disable all {} stuff
Or use SendRaw to disable all {} stuff
Code: Select all
Send, {{} ; Sends {
Send, {}} ; Sends }
Send, {{}{}} ; Sends {}
SendRaw, {} ; Sends {}
Send, {Raw}{} ; Sends {}
Re: How to make AHK to type braces (curly brackets)
As easy as that, eh? Thanks a lot, GeekDude!
Re: How to make AHK to type braces (curly brackets) Topic is solved
This solution works for curly braces in short cuts as well (thanks)
e.g.
\scpr::${{}PWD/html/release/{}}
yielding
${PWD/html/release/}
e.g.
\scpr::${{}PWD/html/release/{}}
yielding
${PWD/html/release/}
Re: How to make AHK to type braces (curly brackets)
Thanks for the tip, i made a little snippet to escape them:
Code: Select all
EscapeCurly(text) {
; str := StrReplace(str, "{", "{{}" ; Sends {
; str := StrReplace(str, "}", "{}}" ; Sends }
; return StrReplace(str, "{}", "{{}{}}" ; Sends {}
Loop, Parse, text ; retrieves each character from the variable, one at a time
{
if (A_LoopField == "{") {
str .= "{{}"
} else if (A_LoopField == "}") {
str .= "{}}"
} else {
str .= A_LoopField
}
}
return str
}