| View previous topic :: View next topic |
| Author |
Message |
Mountie
Joined: 30 Oct 2007 Posts: 13
|
Posted: Mon Nov 05, 2007 8:46 pm Post subject: hotsring to call function |
|
|
Is it possible to have a hotstring call an autohotkey function?
(how would this be coded?)
Thank you. |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 6847 Location: Pacific Northwest, US
|
Posted: Mon Nov 05, 2007 8:59 pm Post subject: |
|
|
in general, yes - what do you want it to call? _________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM |
|
| Back to top |
|
 |
ManaUser
Joined: 24 May 2007 Posts: 906
|
Posted: Mon Nov 05, 2007 9:17 pm Post subject: |
|
|
Here's a simple example:
| Code: | :*:test::
DoMsg("This is a test.")
return
DoMsg(Input)
{
MsgBox %Input%
} |
Or maybe you didn't really mean a function in the technical sense. In that case you just put whatever code you want in place of DoMsg("This is a test.") and omit the second part. |
|
| Back to top |
|
 |
Mountie
Joined: 30 Oct 2007 Posts: 13
|
Posted: Tue Nov 06, 2007 2:28 am Post subject: |
|
|
| Thank you. I have it working now. I was trying to call a user defined function. My string was being expanded, but the UDF not being called. I believe it was because the call was on the same line as the hotstring. |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 6847 Location: Pacific Northwest, US
|
Posted: Tue Nov 06, 2007 7:31 pm Post subject: |
|
|
| Mountie wrote: | | I believe it was because the call was on the same line as the hotstring. |
That is correct, you can't have an autoreplace hotstring AND a function called. _________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM |
|
| Back to top |
|
 |
|