0
I'm new to AHK and I'm trying to write a script which does the following:
I press F3 and then there is a mouse click at certain coordinates on the screen and then the cursor goes back into its original position, so it doesn't look like the script caused the cursor to move at all. I'm basically trying to create a hotkey for a button on screen because the developers of the software did not add this functionality to the app.
This is what I have so far:
#F3::
CoordMode, ToolTip, Screen
MouseGetPos, X, Y
Click 512, 516
MouseMove, %X%, %Y%
Return
However, when I now press F3, nothing happens. I have tried removing the key binding and the Return command so that double-clicking the script just does what pressing F3 should do and it works perfectly. Any help as to what I'm doing wrong?
That did fix the problem of the action not happening. However, it still doesn't seem to work when the window of the app is active, which makes it pretty useless. Any way to make it work in the program? – Arkansin – 2017-07-31T03:56:04.280
No, Arkansin! Don't do it! Don't take a correct answer to this core question (why the binding isn't working) and fail to accept the answer, and then ask a separate question in the comments. Silas B did his job right, of providing the right answer. Don't try to make him work further before giving him due credit. First, accept his answer. Then, if you want more detail in a way that is really a different question, just make a new question on the site. (If you want, you can message Silas B to point Silas B to the new question.) – TOOGAM – 2017-07-31T06:16:27.597
Thanks so much Toogam for an irrelevant and unnecessary comment. FYI I was going to choose Silas B's answer as the correct answer anyway, but waited for the further clarification for two reasons:
while helpful, is not the complete answer since my issue still persists. But yeah, thanks for swooping in. SIGH – Arkansin – 2017-07-31T08:03:54.457