| View previous topic :: View next topic |
| Author |
Message |
Hound
Joined: 15 Apr 2005 Posts: 4
|
Posted: Fri Apr 15, 2005 11:38 pm Post subject: Unwanted script exiting |
|
|
Certainly a simple question that probably has a simple answer:
I need to define a hotkey at the beginning of the script to exit the script at any time during execution. To do this i have simply added the following line at the start of the script:
s::ExitApp
When i try to run the script however, it exits the second it sees the hotkey declaration. Why? |
|
| Back to top |
|
 |
DrSamRaza_1
Joined: 15 Apr 2005 Posts: 8 Location: Pakistan
|
Posted: Fri Apr 15, 2005 11:43 pm Post subject: |
|
|
Try
_________________ Intelligence helps, but hard work is the key to Success |
|
| Back to top |
|
 |
Titan
Joined: 11 Aug 2004 Posts: 5130 Location: eth0 ::1
|
Posted: Sat Apr 16, 2005 12:41 am Post subject: Re: Unwanted script exiting |
|
|
| Hound wrote: | | When i try to run the script however, it exits the second it sees the hotkey declaration. Why? |
Put a Return statement before the hotkey definition (otherwise it would act through it). It doesn't matter where hotkeys are in a script; use #Persistent for hotkey-driven scripts. _________________
RegExReplace("irc.freenode.net/ahk", "^(?=(.(?=[\0-r\[]*((?<=\.).))))(?:[c-\x73]{2,8}(\S))+((2)|\b[^\2-]){2}\D++$", "$u3$1$3$4$2") |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Sat Apr 16, 2005 1:08 am Post subject: |
|
|
Unlike normal labels, into which the auto execute section will fall if there is no "return" to stop them, hotkeys and hotstrings will implicitly end the auto execute section.
In light of this, I'm not sure what the problem could be in this case, nor can I reproduce it. Perhaps you pressed the letter S accidentally? |
|
| Back to top |
|
 |
Guest
|
Posted: Sat Apr 16, 2005 2:44 am Post subject: |
|
|
| Thanks for the help. I just put the hotkey definition at the end of the script instead of the beginning. Although this should not make a difference ( I suppose) because hotkeys are processed at script load (?), the script works perfectly now. |
|
| Back to top |
|
 |
|