| View previous topic :: View next topic |
| Author |
Message |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10450
|
Posted: Thu Jan 19, 2006 11:41 pm Post subject: v1.0.41 released: Context-sensitive hotkeys & hotstrings |
|
|
Here are the changes for v1.0.41:
Fixed "Transform HTML", which was broken by v1.0.40.02. [thanks Rabiator]
Improved syntax to support One True Brace (OTB) style with IFs, ELSEs, functions, and normal loops.
Added built-in variable A_AhkPath, which contains the full path and name of AutoHotkey.exe (if available).
Added directives #IfWinActive/Exist to enable selected hotkeys and hotstrings for only the windows you specify.
Last edited by Chris on Mon Jan 23, 2006 2:15 am; edited 1 time in total |
|
| Back to top |
|
 |
toralf
Joined: 31 Jan 2005 Posts: 3842 Location: Bremen, Germany
|
Posted: Fri Jan 20, 2006 8:30 am Post subject: |
|
|
Thanks for the OTB, although it will require to change a lot in the Auto-Syntax-Tidy, I believe it is a good improvement. _________________ Ciao
toralf  |
|
| Back to top |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6702 Location: France (near Paris)
|
Posted: Fri Jan 20, 2006 10:09 am Post subject: |
|
|
Yeah!
I don't care much for the OTB, as I don't use this style of coding, but it is nice for those which cannot live without it...
I eagerly awaited the context sensitive hotkeys.
Indeed, there was workarounds like: | Code: | $F9::
appName = Create Folder
WinGetClass winClass, A
If winClass != ExploreWClass
{
; MsgBox 16, %appName%, Oops, wrong window...
Send {F9}
return
}
| but it wasn't very nice, adding a lot of code and not being very readable.
Your solution is nice, very well made (the idea of group of windows is excellent) and practical.
Congratulations, you are doing an excellent job on this software! |
|
| Back to top |
|
 |
Titan
Joined: 11 Aug 2004 Posts: 5007 Location: imaginationland
|
Posted: Fri Jan 20, 2006 1:04 pm Post subject: |
|
|
| The OTB feature adds greater flexibility to the way scripters can code which is terrific. The window-specific hotkeys are also a useful addon. Thanks Chris. |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10450
|
Posted: Fri Jan 20, 2006 2:30 pm Post subject: |
|
|
Thanks. The #IfWin feature isn't as useful as I'd originally envisioned because I ran into some roadblocks when trying to implement it (such as thread-safety in the hook thread).
Hopefully the feature will get improved to support %Var% in parameters. Eventually, it may also allow duplicate hotkey labels as Evl suggested at http://www.autohotkey.com/forum/viewtopic.php?t=7485 |
|
| Back to top |
|
 |
Demokos
Joined: 28 Dec 2005 Posts: 84
|
Posted: Fri Jan 20, 2006 6:40 pm Post subject: |
|
|
| Chris wrote: | | Hopefully the feature will get improved to support %Var% in parameters. | I would like to see that. Thanks for this very usefull release. |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Sat Jan 21, 2006 4:16 pm Post subject: |
|
|
| Quote: | | Improved syntax to support One True Brace (OTB) style with IFs, ELSEs, functions, and normal loops. | Kinda coincidence . I had a look at Perl two days ago. To get into the right mood for that, I've checked a script of one of my colleagues and have seen that style of coding for the first time (well, I'm not a programmer ). Whopeee, that means that I can use the same technique with AHK & Perl.
Thx.  |
|
| Back to top |
|
 |
beardboy
Joined: 02 Mar 2004 Posts: 444 Location: SLC, Utah
|
Posted: Sat Jan 21, 2006 11:25 pm Post subject: |
|
|
With the #IfWin directives, can ahk_id be added as a WinTitle option? The use will be rare, so only if it doesn't add a lot of code size or time to add.
thanks,
beardboy |
|
| Back to top |
|
 |
evl
Joined: 24 Aug 2005 Posts: 1237
|
Posted: Sun Jan 22, 2006 12:34 am Post subject: |
|
|
| As beardboy said, it would be handy - it would also be more consistent with other commands. To be useful though, it would need to be able to accept variables for the ID (as Chris already mentioned might be added). |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10450
|
Posted: Sun Jan 22, 2006 3:37 am Post subject: |
|
|
I believe ahk_id and ahk_pid are already supported. The only reason they're not mentioned is what Evl said: Without %Var% support, they would be useful only in unusual circumstances such as a script creating another script via FileAppend.
However, it might be of use that GroupAdd can add a series of ahk_id's or ahk_pid's to a group. You can then use that group with #IfWin. Also, you can keep adding more id's and pid's to such a group as long as you want -- and as long as the list doesn't get huge, performance shouldn't be affected much. |
|
| Back to top |
|
 |
beardboy
Joined: 02 Mar 2004 Posts: 444 Location: SLC, Utah
|
Posted: Sun Jan 22, 2006 4:05 am Post subject: |
|
|
Chris, thanks for the work around solution.
thanks,
beardboy |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10450
|
Posted: Tue Jan 31, 2006 11:17 pm Post subject: |
|
|
Here are the changes for v1.0.41.01:
Fixed AltGr hotkeys that send AltGr characters such as "<^>!a::Send \" in German. [thanks AGU]
Fixed Gui +Disable/AlwaysOnTop to work even if other options are present on the same line. [thanks evl]
Improved syntax to support having a command on the same line as an open-brace. [thanks segfault]
The tentative plan for the next major release is to support duplicate hotkeys and hotstrings for easier context sensitivity with the #IfWin directives. |
|
| Back to top |
|
 |
Titan
Joined: 11 Aug 2004 Posts: 5007 Location: imaginationland
|
Posted: Tue Jan 31, 2006 11:27 pm Post subject: |
|
|
| Chris wrote: | | Improved syntax to support having a command on the same line as an open-brace. [thanks segfault] |
Nice one however this does not apply to OTB. Is this intentional?
For example this works: | Code: | Loop, 3
{ MsgBox, %n%
n += 10
} | But not this (OTB): | Code: | Loop, 3 { MsgBox, %n%
n += 10
} |
_________________
RegExReplace("irc.freenode.net/autohotkey", "^(?=(.(?=[\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: 10450
|
Posted: Wed Feb 01, 2006 12:32 am Post subject: |
|
|
Yes, it's intentional because the extra code size didn't seem justified given how rarely anyone would want to use such an ugly style
It is also documented on the Block page under the OTB section: "However, open-braces of the One True Brace style do not support commands to their right." |
|
| Back to top |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6702 Location: France (near Paris)
|
Posted: Wed Feb 01, 2006 9:28 am Post subject: |
|
|
Well, I do find the first style (the one you just allowed) ugly too, perhaps that's why it is rarely used.
Ugly and impratical if you have to add a new command just before the first line of the block.
And with no clear advantage over the OTB style, ie. no gain of line. Well, at least, braces are aligned, I find this more readable than OTB.
But well, it is good to have flexibility and to please as much people as possible, as long this doesn't bloat the code. Which seems to be a true concern for Chris I like that. |
|
| Back to top |
|
 |
|