Simple key to end process?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
AnimeSan
Posts: 7
Joined: 29 Jul 2017, 03:08
Contact:

Simple key to end process?

24 May 2018, 19:16

Hello, I have the following simple script written:

Code: Select all

Loop {
	MouseMove, 1503,372
	Sleep, 100
	Click
	Sleep, 100
	Send ^v
	Sleep, 200
	Send {Enter}
	Sleep 400
	Send {Enter}
	Sleep 400
	Send {Enter}
	Sleep 100
}

And want to know how to make it so pressing Escape ends the script. I tried putting Esc::ExitApp in different locations but none of them worked properly.

Thanks in advance
User avatar
TLM
Posts: 1608
Joined: 01 Oct 2013, 07:52
Contact:

Re: Simple key to end process?

24 May 2018, 19:27

AnimeSan wrote:I tried putting Esc::ExitApp in different locations...
Can you please explain what you mean by "different locations" ? It really should work
AnimeSan
Posts: 7
Joined: 29 Jul 2017, 03:08
Contact:

Re: Simple key to end process?

25 May 2018, 11:05

I tried putting it before the loop, at the end of the loop, and right after the loop? putting it before didnt start the loop, putting it in the loop made the loop stop after one loop, and putting it after did not let me click escape to end the script.
User avatar
TLM
Posts: 1608
Joined: 01 Oct 2013, 07:52
Contact:

Re: Simple key to end process?

25 May 2018, 12:35

Hotkeys themselves aren't to be placed within loops ( although the Hotkey command can be )
This works for me:

Code: Select all

Loop {
	MouseMove, 1503,372
	Sleep, 100
	Click
	Sleep, 100
	Send ^v
	Sleep, 200
	Send {Enter}
	Sleep 400
	Send {Enter}
	Sleep 400
	Send {Enter}
	Sleep 100
}
return ; << not necessarily needed in this case

Esc::ExitApp

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: wilkster and 321 guests