I've been trying to get my AHK-Script running in SSMS2017 to execute a single (multi-line) SQL Statement (similar to Ctrl+Enter in SQL Developer).
The idea is that I search for the last (with respect to the last caret position) ";" in my code and highlight the text until the next one and then execute it with F5.
So far my script looks like that:
^ENTER::
CoordMode, Caret, Screen
CoordMode, Mouse, Screen
send ^f
sendraw `;
send {Enter}
send {Esc}
send +{F3}
send {Right}
X1 = A_CaretX
Y1 = A_CaretY
send {F3}
send {Right}
X2 = A_CaretX
Y2 = A_CaretY
MouseClickDrag, Left, X1,Y1,X2,Y2, 100
send {F5}
return
which in my opinion at least syntactically should work. But it doesn't. Apparently because A_CaretX and A_CaretY seem to be empty (I've let AHK output them to me and they are blank). Does anyone know a solution to this problem?