AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Can there be two or more #Persistent cmds in one script??

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Spike



Joined: 24 Jun 2005
Posts: 12

PostPosted: Tue May 30, 2006 10:24 am    Post subject: Can there be two or more #Persistent cmds in one script?? Reply with quote

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
View user's profile Send private message
evl



Joined: 24 Aug 2005
Posts: 1238

PostPosted: Tue May 30, 2006 11:21 am    Post subject: Reply with quote

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
View user's profile Send private message
Spike



Joined: 24 Jun 2005
Posts: 12

PostPosted: Tue May 30, 2006 12:02 pm    Post subject: Reply with quote

Thanks evl,
That fixed it and cleared up a few problems I had understanding about the autoexec sections

Thanks
Jan
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group