AutoHotKey - change mouse position and click a specific key every time window comes up

Posted by John on Super User See other posts from Super User or by John
Published on 2013-06-29T00:47:44Z Indexed on 2013/06/29 4:23 UTC
Read the original article Hit count: 406

Filed under:
|

I'm a newbie to AHK, learning the basics. I'm using Notepad as an example - I want to hit the Cancel key every time I close Notepad and it asks if I want to Save/Don't Save/Cancel.

I've come up with the script below and it works once but then I have to reload the script to do it again. I want it to hit Cancel every time the question box comes up. I thought Loop would work but am doing something wrong. Any ideas why, anyone?

Loop
IfWinExist Notepad,
{
    WinWait Notepad
    WinActivate
    Click 312, 109
    return
}

© Super User or respective owner

Related posts about windows-7

Related posts about autohotkey