| View previous topic :: View next topic |
| Author |
Message |
0inprogram
Joined: 06 Dec 2007 Posts: 21 Location: chennai
|
Posted: Sat Dec 15, 2007 2:00 pm Post subject: if window exist run a process |
|
|
i m a newbie
i want to execute a set of instructions until a window exists....
then stop the process when the window is closed.
i tried doing this with IfWinExist and loop....
but the process continued even after the window was closed....
wht i tried was something like this....
IfWinExist, windows media player
{
loop
{...........
...........
...........
return
}
}
the script made the process to continue even after the window was closed......
pls help |
|
| Back to top |
|
 |
tic
Joined: 22 Apr 2007 Posts: 1375
|
Posted: Sat Dec 15, 2007 3:26 pm Post subject: |
|
|
| NB: You dont put a return at the end of a loop to re-execute it, and also check which SetTitleMatchMode is set. |
|
| Back to top |
|
 |
dmatch
Joined: 15 Oct 2007 Posts: 113
|
Posted: Sat Dec 15, 2007 3:46 pm Post subject: Re: if window exist run a process |
|
|
| 0inprogram wrote: | until a window exists....
then stop the process when the window is closed. |
If you meant window exits then try this:
| Code: | IfWinExist, AutoHotkey Help
{
Loop
{
MsgBox, ,Test,Help is Running,1
sleep,2000
ifWinNotExist, AutoHotkey Help
break
}
}
| and watch out for case sensitivity of window titles and, as mentioned by Tic, SetTitleMatchMode if necessary.
dmatch |
|
| Back to top |
|
 |
0inprogram
Joined: 06 Dec 2007 Posts: 21 Location: chennai
|
Posted: Sun Dec 16, 2007 6:36 am Post subject: |
|
|
i tried the code u posted....
but its working only for the first time after the script is loaded
after tht it doesnt show a response... when the application is opened |
|
| Back to top |
|
 |
flashmaniac Guest
|
Posted: Sun Dec 16, 2007 10:03 am Post subject: try this |
|
|
| 0inprogram wrote: | i tried the code u posted....
but its working only for the first time after the script is loaded
after tht it doesnt show a response... when the application is opened |
| Code: |
!1:: ; Alt + 1
IfWinExist, AutoHotkey Help
{
Loop
{
MsgBox, ,Test,Help is Running,1
sleep,2000
ifWinNotExist, AutoHotkey Help
break
}
Return
}
|
Give That A Go...
Otherwise You Could Use The #persistant Function |
|
| Back to top |
|
 |
|