Page 1 of 1

run & winexist 問題 請大家指教  Topic is solved

Posted: 26 Sep 2018, 20:41
by adrian_9832
以下是小弟的 CODE 請問如何才可以生效?

Run, Notepad.exe

IfWinExist, 未命名 - 記事本
{
WinActivate
WinMaximize
Send, Some text.{Enter}
return
}

return

Re: run & winexist 問題 請大家指教

Posted: 27 Sep 2018, 10:38
by garry

Code: Select all

#warn
setworkingdir,%a_scriptdir%
Settitlematchmode,2
SetKeyDelay,20,20
sc=ahk_exe notepad.exe
IfWinNotExist,%sc%
 Run,notepad,,,
IfWinNotActive ,%sc%,,WinActivate,%sc%
WinWaitActive,%sc%
Sleep 400
ControlSend ,,Some text`nNext line`n, %sc%
return