| View previous topic :: View next topic |
| Author |
Message |
Spike
Joined: 24 Jun 2005 Posts: 12
|
Posted: Tue May 30, 2006 10:24 am Post subject: Can there be two or more #Persistent cmds in one script?? |
|
|
Hi ,
I'm trying to get this script to run.
The script is to watch & wait for certain windows to become active and then do certain commands.
Here's the code.
;/*
#Persistent
SetTimer, Alert1, 500
return
Alert1:
IfWinNotExist, AutoHotkey Help
return
; Otherwise:
SetTimer, Alert1, Off ; i.e. the timer turns itself off here.
msgbox AutoHotkey Help Active
return
;*/
#Persistent
SetTimer, Alert2, 500
return
Alert2:
IfWinNotExist,Export Registry File
return
; Otherwise:
SetTimer, Alert2, Off ; i.e. the timer turns itself off here.
msgbox Export Registry File Active
return
Basicaly the second window never gets detected unless the first window is detected .
BTW the code is from the helpfile with the window names changed.
I would like to integrate this into my autohotkey.ini
TIA
Jan |
|
| Back to top |
|
 |
evl
Joined: 24 Aug 2005 Posts: 1238
|
Posted: Tue May 30, 2006 11:21 am Post subject: |
|
|
| Quote: | #Persistent
Keeps a script permanently running (that is, until the user closes it or ExitApp is encountered).
|
It only relates to the script, not a specific command. Put all the SetTimer commands at the start if you want them runnign all the time. |
|
| Back to top |
|
 |
Spike
Joined: 24 Jun 2005 Posts: 12
|
Posted: Tue May 30, 2006 12:02 pm Post subject: |
|
|
Thanks evl,
That fixed it and cleared up a few problems I had understanding about the autoexec sections
Thanks
Jan |
|
| Back to top |
|
 |
|