AutoHotkey_L
Introduction
AutoHotkey_L is a custom build of AutoHotkey maintained by Lexikos. Features include:
Features which have been incorporated into mainstream AutoHotkey as of v1.0.48 include:
For a full list of changes, see Version History.
Discuss AutoHotkey_L at the AutoHotkey Community Forums.
Get It
The following files are available for the current revision:
AutoHotkey_Lw.zip - Unicode binaries: recommended for new scripts.
AutoHotkey_La.zip - ANSI binaries: better compatibility with some older scripts.
AutoHotkey_L_Docs.zip - contains all of the documentation available from this page
Source code is available via git or http download at github.
Note:
- Visual C++ 2008 Express Edition may be required to open the included Solution or Project files.
- My changes and additions to the source code may be used in any way, without restriction.
Version History
Revision 45 - February 8, 2010
- Added _GetAddress; _SetCapacity/_GetCapacity may now operate on a given field. [more info]
- Added workaround for WM_PAINT infinite loop often caused by subclassing.
- Allow obj.() as a means to call the default method of an object; equivalent to obj[""]().
- Dev: Added solution and project files for MSBuild 4.0 & VS2010. [more info]
- Fixed (Unicode): 'Running' column in ListHotkeys.
Revision 44 - February 7, 2010
- Fixed: Attempting to set "nothing" crashed the script. For instance, x[]:=z.
- Fixed (Unicode): Unable to find default script (Documents\AutoHotkey.ahk).
- Fixed (Unicode): A_Desktop, A_ProgramFiles and several other built-in variables which read their value from the registry caused strings to be incorrectly terminated.
- Fixed (ANSI): Characters in the range 0x80-0xFF couldn't be found by InStr or StringReplace.
- Changed (ANSI): Treat ToCodePage/FromCodePage like other unsupported/invalid subcommands.
Revision 43 - January 29, 2010
- Fixed: obj.Func() resulting in a random integer when it should be an empty string.
Revision 42 - January 28, 2010
- Merged with AutoHotkeyU. See comparison of features.
- Numerous bug-fixes and improvements, some relating to the merge.
Revision 41 - December 20, 2009
- Fixed: Floating-point numbers were equivalent to an empty string when used as keys in objects. They are now converted to numeric strings in the current float format, as originally intended.
Revision 40 - December 13, 2009
- Changed meta-functions and multi-param behaviour to improve flexibility. Meta-functions are now invoked *before* searching for an appropriate field in each base object; however, values in x.base will override meta-functions defined in x.base.base. Chaining meta-functions (inheritence) is now possible by avoiding "Return"
- Improved Default Base functionality to be more consistent with real objects.
- Changed (Debugger): While stepping through code, skip all braces except those which end a function.
- Changed (Debugger): When stepping onto the hidden "Exit" at end of the script, consider it to be *below* the last physical line to avoid confusion.
Revision 39 - December 2, 2009
- Fixed (Debugger): Error in Base64 decoding used by property_set.
Revision 38 - November 17, 2009
- Added: #MenuMaskKey directive to change which key is used to mask Alt/Win keyup events. See this thread for background information.
- Changed: If x[1,2]:=3 creates an object for x[1], it's base is no longer automatically set to x.base. See the documentation for a method of controlling this behaviour.
Revision 37 - November 7, 2009
- Added: Support for obj[method_name](params) object-call syntax.
Revision 36 - November 4, 2009
- Changed: If x.y or similar is immediately followed by an open-bracket ([), the right-most identifier preceding the bracket is treated as the first parameter of the operation. For instance, a.b.c[d] is equivalent to ObjGet(a.b,"c",d) and x.y[z]:=v is equivalent to ObjSet(x,"y",z,v). Previously each sub-expression preceding a bracket was evaluated separately.
- Changed: If a method-call such as x.y() is followed immediately by an assignment, the parentheses are treated as brackets. For instance, x.y(z):=v is now equivalent to ObjSet(x,"y",z,v).
- Fixed: If(expr) and While(expr) with no delimiting space or comma.
Revision 35 - October 25, 2009
- Fixed: Standalone expressions beginning with two or more "dots", such as x.y.z(). (Broken by L34.) Note that '(' or '[' or ':=' is still required.
Revision 34 - October 24, 2009
- Changed: Setting a value within an object to an empty string now stores the empty string rather than removing the key-value pair from the object. _Remove can still be used to completely remove key-value pairs.
- Changed: Command names must be terminated with a space, tab or comma. The following characters no longer bypass this requirement: <>:+-*/!~&|^[]. For instance, syntax errors such as MsgBox< foo and If!foo are now caught at load-time.
- Fixed: Return now properly handles expressions which result in a variable containing an object. For instance, Return x:=y, Return (x), Return x,... and similar should work now (Return x already worked).
- Fixed: Multi-parameter get/set did not correctly support meta-functions for multiple objects (such as for x and x[y] in the expression x[y,z]).
- Fixed: Cascading object-assignments such as the x[y]:=z in r:=x[y]:=z could not yield numbers or objects - broken by L33.
- Fixed: x._Remove(y) crashed the script or removed the wrong item if x did not contain y.
- Fixed: x.=y, if x.y=... and similar. May affect other expressions.
- Fixed: Standalone ternary expressions no longer requires spaces. For instance, x? F(1) : F(2) is now allowed.
- Debugger: On script exit, disconnect debugger *after* releasing objects to allow debugging of __Delete handlers.
Revision 33 - October 3, 2009
- Fixed: Local variables were not automatically freed for functions which return objects or pure numbers.
- Fixed: Two separate reference-counting errors related to ternary operator and Object().
- Fixed: If a string returned by a scripted object function was assigned directly to a variable, the variable's length was set incorrectly.
- Fixed: If the last operation in an expression retrieved a string from a temporary object, the object and string were freed prematurely.
- Fixed: Numeric strings with special formatting were not preserved when returned from a function via a variable or passed to a recursive function.
- Fixed: If the final result of an expression (other than for Return) is an object, correctly yield an empty string instead of silently aborting the thread.
- Fixed: __Delete meta-functions sometimes overwrote temporary values in the deref buffer.
- Added: An address retrieved via &object may be cast back into an object reference by using Object(address).
Revision 32 - September 26, 2009
- Fixed: Send/PostMessage crash when less than three parameters were specified.
Revision 31 - September 26, 2009
- Added: Object/array support and numerous minor changes to make this possible.
- Added: Support for While(expression) with no delimiting space.
- Added: Trim, LTrim, RTrim.
- Added: A ~= B; equivalent to RegExMatch(A, B). May be removed in a future revision.
- Fixed: An incompatibility with LowLevel.
- Changed: Characters [, ] and ? are no longer valid in variable names. Consequently, ? (ternary) no longer requires a space on either side.
- Changed: Optional parameters may now be omitted at any position in the parameter list of a non-dynamic function call. Since this works by automatically inserting the parameter's default value at load-time, it is not supported or allowed for dynamic function-calls.
- Debugger: Various minor changes to make program flow easier to follow while stepping through code.
- Optimization: If DllCall's first parameter is a literal string which identifies a function already present in memory, it is replaced with the actual address of the function.
- Updated from v1.0.48.03 to v1.0.48.04.
Revision 30 - May 31, 2009
- Updated from v1.0.48.02 to v1.0.48.03.
Revision 29 - May 2, 2009
- All supported image formats may now be used as menu icons. Currently it is necessary to specify "actual size" when setting the icon to preserve transparency on Windows Vista and later. For example:
Menu, Icon, MenuItemName, Filename.png,, 0
Revision 28 - May 2, 2009
- Improved average-case performance of dynamic function calls by implementing binary search for function name look-ups. This change also applies to other areas, such as load-time resolution of function references in expressions and run-time resolution by OnMessage, RegisterCallback, etc.
Revision 27 - April 26, 2009
- Updated from v1.0.48.00 to v1.0.48.02.
Revision 26 - April 11, 2009
- Fixed: Menu icons were not drawn on items which have sub-menus if owner-drawing was in use.
- Fixed: Menu icons were not freed if all menu items were deleted at once.
- Changed (Source): Renamed AutoHotkey.sln to AutoHotkey_L.sln to allow VS window to be identified more easily.
Revision 25 - March 30, 2009
- Fixed: Send {U+xxxx} correctly sets modifier key-state as with any normal key.
- Fixed: Send {U+..xx} no longer triggers hotkey SCxx.
Revision 24 - March 30, 2009
- Added: Support for Send {U+xxxx}. SendInput() is used where available for proper unicode support, otherwise falls back to Alt+Numpad.
Revision 23 - March 30, 2009
- Fixed: GuiControl, Enable/Disable now only resets focus if the focused control was disabled.
Revision 22 - March 26, 2009
- Optimized If var [not] in/contains MatchList, especially for long lists containing shorter fields.
Revision 21 - March 16, 2009
- Minor optimizations to While. [thanks Chris]
- Fixed (Debugger): Revisions 19 and 20 omitted timer threads from the call stack.
- Fixed (Debugger): XML-reserved characters were not escaped in most situations.
- Fixed (Debugger): Incorrect command and transaction_id were used in the final response before exiting the script.
Revision 20 - February 27, 2009
- Changed: If an icon cannot be loaded with the new method, fall back to the old method.
Revision 19 - February 26, 2009
- Added: Gui, Font, qN option to set font quality/control anti-aliasing, where N is between 0 and 5.
- Fixed: IL_Add now loads icons at the most appropriate size when multiple sizes exist.
- Merged with AutoHotkey v1.0.48, introducing bug fixes, optimizations and other changes by Chris. Some AutoHotkey_L features were integrated into the mainstream release; changes to these features since previous revisions are as follows:
- Legacy behaviour is no longer applied to While - e.g. "While %x%" is correctly interpreted as a double-deref rather than as "While x".
- One-True-Brace style is now supported for While.
- Static vars may now be declared and initialized in assume-static functions.
- Passing too few parameters in a dynamic function call is no longer allowed, as it allows the function's caller to second-guess the function's designer, reduces the ability to detect script bugs at runtime, and may cause the application to crash if calling a built-in function.
Revision 18 - February 21, 2009
- Fixed: Incomplete bug-fix in previous revision causing concat followed by assignment to skip the rest of the expression in some cases.
Revision 17 - February 20, 2009
- Added: Menu icons via Icon and NoIcon sub-commands of the Menu command.
- Changed: Negative icon numbers can now be used to indicate a resource ID within an executable.
- Changed: Set default style of menus to include MNS_CHECKORBMP.
- Changed: Load both small and large versions of custom tray icons to allow the correct icons to be shown in the appropriate places.
- Fixed: Loading of icons from executable files at sizes other than the system small/large.
Revision 16 - February 4, 2009
- Fixed: Deleting a menu item partially deleted its associated sub-menu.
Revision 15 - February 1, 2009
- Fixed: SetFormat's presence in a *compiled* script was not disabling binary number write-caching. SetFormat should now work correctly in compiled scripts.
Revision 14 - February 1, 2009
- Numerous bug-fixes and optimizations by Chris (pre-v1.0.48 beta).
- Added: Support for regex callouts and the auto-callout option 'C'.
- Changed: A_AhkVersion now includes the revision number. For instance, this is 1.0.47.07.L14.
- Fixed: HWND's/window ID's were sign-extended to 64-bit. For instance, 0xb482057e became 0xffffffffb482057e.
Revision 13 - November 29, 2008
- Fixed: Invalid DllCall types were treated as INT in some build environments.
- Added: Workaround for GuiEscape issue when disabling focused control.
- Changed version info: InternalName, ProductName and FileDescription are now "AutoHotkey_L" instead of "AutoHotkey".
Revision 12 - September 6, 2008
- Fixed: Potential access violation when using property_get on a built-in variable. -- DBGP
Revision 11 - September 5, 2008
- Fixed: Remove checksum from AutoHotkeySC.bin via post-build script (AutoHotkey must be installed).
- Added: .L suffix to A_AhkVersion.
- Added: Preliminary support for DBGp (interactive debugging).
Revision 10 - August 2, 2008
- Fixed: WheelLeft/WheelRight support, which was broken in revision 9.
Revision 9 - July 29, 2008
- Fixed: Allow Break/Continue in While.
- Fixed: TrayTip in non-English Windows and possibly other side-effects of using Vista headers.
Revision 8 - July 27, 2008
- Added: #IfTimeout directive to set the timeout for evaluation of #If expressions, in milliseconds. Default is 1000.
- Added: Assume-static mode for functions. "Static" must precede any local/global variable declarations.
- Added: One-true-brace support for While.
- Changed: While now sets A_Index to the iteration about to begin.
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.
Revision 5 - July 19, 2008
- Cleaned up obsolete references to test scripts.
- Added basic default test script.
Revision 4 - July 18, 2008
- Added: #if (expression) - Similar to #IfWinActive, but for arbitrary expressions.
- Added: WheelLeft, WheelRight - Support for WM_MOUSEHWHEEL, which was introduced with Windows Vista. (Requires Vista.)
- Added: While, expression - Loop while a condition is true.
- Added: A_IsPaused - True if the underlying thread is paused.
- Added: A_IsCritical - True if the current thread has been marked uninterruptible by the "Critical" command.
- Changed: Allow any number of parameters to be passed in dynamic function calls.
- Fixed: Access Violation caused by WinGetClass and subclassed windows.
- Fixed: Access Violation caused by empty dynamic function references.