Reputation: 3782
As I've started using AutoHotKey daily, I thought it'd be a good idea to implement it in my coding.
I'd like it to create a structure like this:
{
(Tab)
}
when {
followed by an Enter
are entered.
So far, I've got:
:*{Enter::
SendInput, {{}
SendInput, {Enter}
SendInput, {Enter}
SendInput, {}}
SendInput, {Up}
SendInput, {Tab}
return
but I keep getting errors and strange anomalies.
Upvotes: 0
Views: 2159
Reputation: 1
This hotstring worked for me.
:*:`{`n::
That should catch it without need for settning the EndChars.
Upvotes: 0
Reputation: 2999
There are 2 things that must be included in order to get your code to work: 1. a backtick must be used for a curly bracket to be in hotstring 2. the option 'o' must be used to prevent a return from being sent after a curly bracket within your send command.
Try the following:
:o:`{::{{}`n`n{}}{up}{tab}
Note: You may need to modify ending characters for this to fire only on Enter. This will affect hotstrings globally.
#Hotstring EndChars `n
Upvotes: 2
Reputation: 7953
Try this.
Send, {{}{Enter}{tab}{Enter}{}}{up}{End}
This works for me, but your hotkey "*{Enter" was not accepted by my AutoHotKey_L, so I used an other temporary hotkey "^q".
Upvotes: 0