How to count loop and click OK with ENTER button

Get help with using AutoHotkey and its commands and hotkeys
ejji09
Posts: 14
Joined: 17 Nov 2015, 08:54

How to count loop and click OK with ENTER button

06 May 2019, 09:35

Hi All,

I am trying to count the loops in my script and when the loop start it gives the count in dialog box But then my script runs further only when I press ENTER manual or click the OK button in the loop dialog box., How to click ENTER to make the dialog box close automatically and the script continues further.

Code: Select all

loop, {
n := Format("{:02}", A_Index)
	MsgBox, %n%
	if (A_Index = 4)
    {
		break
	}

SetKeyDelay, -1

sleep 500
run, cmd.exe
Sleep 1000

Send, adb root
Sleep 500
Send {enter}
Sleep 1500
Send {enter}

Send, adb remount
Sleep 500
Send {enter}
Sleep 1500
Send {enter}
}
Thank you
Last edited by ejji09 on 07 May 2019, 02:58, edited 1 time in total.
Rohwedder
Posts: 2222
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: How to count loop and click OK with ENTER button

06 May 2019, 10:14

Hallo,
try:

Code: Select all

MsgBox,,, %n%, 0.5 ;500 ms
or:

Code: Select all

ToolTip, %n%
User avatar
Tomer
Posts: 282
Joined: 21 Aug 2016, 05:11

Re: How to count loop and click OK with ENTER button

07 May 2019, 01:43

untested

Code: Select all

SetTimer, Label, on

loop, {
n := Format("{:02}", A_Index)
	MsgBox,,popupmsg, %n%
	if (A_Index = 4)
    {
		break
	}

SetKeyDelay, -1

sleep 500
run, cmd.exe
Sleep 1000

Send, adb root
Sleep 500
Send {enter}
Sleep 1500
Send {enter}

Send, adb remount
Sleep 500
Send {enter}
Sleep 1500
Send {enter}
}

Label:
IfWinExist, popupmsg
{
   sleep, 500
   ControlClick, Button1, popupmsg  ; click OK
   
   ;~ Send {Enter} ; or send {enter}
}

return

Return to “Ask For Help”

Who is online

Users browsing this forum: Google [Bot], kczx3 and 65 guests