| View previous topic :: View next topic |
| Author |
Message |
Krogdor
Joined: 18 Apr 2008 Posts: 1390 Location: The Interwebs
|
Posted: Tue Aug 12, 2008 3:46 am Post subject: |
|
|
A question about #If (expression)
Is there a way to use this for dynamic hotkeys as well? For example:
| Code: | Hotkey, If (expression)
;would be to
#If (expression)
;as
Hotkey, IfWinActive, somewindow
;is to
#IfWinActive, somewindow |
|
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 7299 Location: Australia
|
Posted: Tue Aug 12, 2008 8:03 am Post subject: |
|
|
I forgot to document the following:
Use Hotkey, If, Expression to modify or create hotkey variants under an existing #If, Expression. For example:
| Code: | Hotkey, If, Expression
;is to
#If, Expression
;as
Hotkey, IfWinActive, somewindow
;is to
#IfWinActive, somewindow
| The comma is optional for #If, but required for Hotkey, If. Expression must match an existing #If, Expression exactly, including case but excluding trailing or leading spaces or tabs. ErrorLevel is set to 1 if it does not exist somewhere in the script.
(The ability to create new #If expressions with the Hotkey command is planned.) |
|
| Back to top |
|
 |
Krogdor
Joined: 18 Apr 2008 Posts: 1390 Location: The Interwebs
|
Posted: Tue Aug 12, 2008 8:14 am Post subject: |
|
|
Aha!
Great, thanks Lexikos.
Also, just for clarification—the #If expression just has to be declared somewhere in the script, but it doesn't have to be the one directly before the Hotkey, If command, right? For example:
| Code: | #If, expression1
Enter:: MsgBox
#If, expression2
G:: MsgBox
Hotkey, If, expression1 |
is valid? |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 7299 Location: Australia
|
Posted: Tue Aug 12, 2008 8:45 am Post subject: |
|
|
| This is a single-line hotkey, which will not execute the line below it. Other than that, your example should work. The #If expression can be anywhere in any file #included in the current script. |
|
| Back to top |
|
 |
Krogdor
Joined: 18 Apr 2008 Posts: 1390 Location: The Interwebs
|
Posted: Tue Aug 12, 2008 5:00 pm Post subject: |
|
|
Okay, thanks for the help.
And I know that the Hotkey, If would never get activated in that example, I just wanted to show an example of an order of #If's and Hotkey, Ifs.
Can't wait to see more of your planned list implemented  |
|
| Back to top |
|
 |
Guest
|
Posted: Thu Aug 14, 2008 7:19 am Post subject: |
|
|
way AWSOME and GREAT Lexikos!!! thank you SO much!!!
is there any way that we can get an alternate extension ie .ahl and a slightly different tray icon (like the olive-color A one)?
i'd like to run both versions for now - and since your version will run "regular" scripts but not visa-versa... |
|
| Back to top |
|
 |
Guest
|
Posted: Thu Aug 14, 2008 8:13 am Post subject: |
|
|
| i just opened test.ahl with your version and it's running just fine - don't know how or why. so that just leaves the tray icon... |
|
| Back to top |
|
 |
Krogdor
Joined: 18 Apr 2008 Posts: 1390 Location: The Interwebs
|
Posted: Thu Aug 14, 2008 8:52 am Post subject: |
|
|
There shouldn't be any reason why Lexikos's version wouldn't work with scripts made in normal AHK—it simply adds more features and optimizes some current ones, so there is no reason why older scripts wouldn't function with it.
Edit: Oops, misread what you wrote. My bad!
| Anonymous wrote: | | i just opened test.ahl with your version and it's running just fine - don't know how or why. |
Is there a reason why you think it wouldn't? Autohotkey scripts are just text files, so the extension doesn't really matter as far as I know. |
|
| Back to top |
|
 |
philz
Joined: 05 Jun 2007 Posts: 89 Location: USA
|
Posted: Mon Aug 18, 2008 11:04 am Post subject: |
|
|
| So are there any plans to merge lexikos' custom build with the official AutoHotkey build? |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 7299 Location: Australia
|
Posted: Mon Aug 18, 2008 11:35 am Post subject: |
|
|
Guest,
ResHacker is the simplest way to change the icons, from a user standpoint.
philz,
No. Since Chris' priorities are different than my own, my build will always be separate. Some features may make it to the official build, however. After discussing briefly with Chris, I think the following are likely candidates:
- Assume-static.
- Flexibility in dynamic function calls, despite the loss of some error-detection ability.
- #If, despite the potential for input lag.
- While, especially after I implement Do..While.
I am currently working on debugging features in the form of DBGp support. The initial release will likely only support the simplest of clients (a modified XDebugClient), with simple breakpoints, step in, step out and step over. |
|
| Back to top |
|
 |
JoeSchmoe
Joined: 17 Feb 2008 Posts: 303
|
Posted: Mon Aug 18, 2008 8:30 pm Post subject: This looks great! |
|
|
| Thanks so much for sharing your build us! some of these features look very helpful! |
|
| Back to top |
|
 |
Guest
|
Posted: Mon Aug 18, 2008 10:29 pm Post subject: |
|
|
| Lexikos wrote: | | especially after I implement Do..While. |
who want Do..While? |
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 2462
|
Posted: Thu Aug 21, 2008 2:19 am Post subject: |
|
|
| Lexikos wrote: | Revision 7 - July 26, 2008
- Added: IsFunc(FuncName) - Returns a non-zero number if FuncName exists in the script or as a built-in function.
|
How about IsFunc() returning the address of a function than 1? Or is there a way to get it without using RegisterCallback and NumGet? |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 7299 Location: Australia
|
Posted: Thu Aug 21, 2008 8:41 am Post subject: |
|
|
There is a reason I worded it as "a non-zero number." Logically it should return a boolean value, but I see more benefit than harm, so I'll add it in the next commit. |
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 2462
|
Posted: Thu Aug 21, 2008 2:11 pm Post subject: |
|
|
| Lexikos wrote: | There is a reason I worded it as "a non-zero number."  | Yes, that led me to have expected a function pointer.  |
|
| Back to top |
|
 |
|