I'm trying to make an automation script that presses Enter when some popup comes up. It seems to identify the popup window, but pressing Enter is not working. The code is like below:
#RequireAdmin
Opt("WinTitleMatchMode", 2)
$hWnd = WinWaitActive("[TITLE:testpop]")
Sleep(300)
Send("{ENTER}")
Your code works fine for me. Are you sure the popup remains "focused"? Or responds to Enter?
$hWnd = WinWait("[TITLE:testpop]")
Sleep(300)
WinActivate($hWnd)
Sleep(300)
ControlSend($hWnd,"",0,"{ENTER}")
This ^ should do the same but slightly on background. You can also click a button with ControlClick if you are able to identify the buttons ID with Au3Info.exe
What kind of popup is it?