| View previous topic :: View next topic |
| Author |
Message |
maxgohan
Joined: 09 Oct 2009 Posts: 81
|
Posted: Wed Mar 17, 2010 12:29 pm Post subject: wait for window to be active to execute script? |
|
|
is there a way to execute a script when a certain window is opened or comes in focus
i've got the following working but i want it to be running in the background and just wait for the window to open to execute the script instead of hitting a hot key to activate.
| Quote: |
!t::
WinWaitActive, AutoHotkey Help
if ErrorLevel
{
return
}
else
msgbox Thanks for opening.
return
|
|
|
| Back to top |
|
 |
Murx Guest
|
Posted: Wed Mar 17, 2010 2:22 pm Post subject: |
|
|
| --> SetTimer |
|
| Back to top |
|
 |
maxgohan
Joined: 09 Oct 2009 Posts: 81
|
Posted: Wed Mar 17, 2010 3:07 pm Post subject: |
|
|
k i tried this and it's not working
| Quote: |
#Persistent
SetTimer, test, 250
return
test:
ifwinactive AutoHotkey Help
msgbox a
return
|
|
|
| Back to top |
|
 |
Leef_me
Joined: 08 Apr 2009 Posts: 5336 Location: San Diego, California
|
Posted: Thu Mar 18, 2010 1:18 pm Post subject: |
|
|
It works! just as you wrote it.
What are the symptoms of it not working? If that makes any sense.
| Code: | #Persistent
SetTimer, test, 250
return
test:
ifwinactive AutoHotkey Help
msgbox a
return
|
|
|
| Back to top |
|
 |
MasterFocus
Joined: 08 Apr 2009 Posts: 3035 Location: Rio de Janeiro - RJ - Brasil
|
Posted: Thu Mar 18, 2010 4:46 pm Post subject: |
|
|
Related: WinTrigger (template) _________________ "Read the manual. Read it again. Search the forum.
Try something before asking. Show what you've tried."
Antonio França
My stuff: Google Profile |
|
| Back to top |
|
 |
|