This document contains a history of changes made within the original branch of AutoHotkey development, by Chris Mallett.
For newer changes, see Changes & New Features.
Fixed crash of SendMessage and PostMessage when wParam or lParam is omitted (broken by 1.0.48.04). [thanks Lexikos]
Fixed StringSplit to work properly inside functions of compiled scripts (broken by 1.0.35.01). [thanks engunneer & Lexikos]
Fixed SendPlay not to wait for the release of the Windows key prior to sending an "L" keystroke (broken by 1.0.48.01). [thanks Lexikos]
Fixed A_EndChar to be valid when the B0 option is present, and to be empty when there is no ending character (broken by 1.0.44.09). [thanks Al2000]
Fixed FormatTime to yield a valid time of day even when the specified month is out-of-range (broken by 1.0.48.00). [thanks silveredge78]
Fixed FileCreateDir to support a leading backslash even when it is the only backslash; e.g. \dir. [thanks jaco0646]
Fixed GuiControl/GuiControlGet/Gui/SendMessage to work reliably even when they trigger a callback or OnMessage function. [thanks Lexikos]
Fixed RegExMatch() not to produce too few replacements when an empty-string match is followed by a non-empty-string match.
Changed While()
to be recognized as a loop rather than a function. [thanks Crash&Burn]
Improved UrlDownloadToFile to support FTP and Gopher. [thanks Lexikos]
Improved the stdout/asterisk mode of FileAppend to write immediately rather than lazily to standard output. [thanks Lexikos]
Added full support for if % expression
. [thanks kenomby]
Fixed ListLines On
not to erase the most recent log entry in the line history. [thanks Lexikos]
Fixed ListView to respond properly to mouse dragging when timers are running. [thanks Solar]
Fixed key-up hotkeys so that if one is created while its key is being held down, the release of the key doesn't trigger the wrong hotkey. [thanks Peter & engunneer]
Changed and fixed Gosub and GroupActivate so that when a function calls an external/public subroutine, that subroutine will treat all dynamic variables as globals, and will have outside-of-function GUI behavior. [thanks kenomby & Lexikos]
Improved performance of True/False/A_EventInfo in expressions by treating them as integers vs. strings.
Changed: For Windows Vista and later, hotkeys that include Win (e.g. #a) will wait for LWin and RWin to be released before sending any text containing an "L" keystroke. This prevents such a hotkey from locking the PC. This behavior applies to all sending modes except SendPlay (which doesn't need it) and blind mode.
Fixed A_LoopFileExt to be blank for any filename having no extension but a period in its pathname. [thanks Yek-Toho-Tua].
Fixed the assignment of integers that are 19 or 20 characters long to work as they did prior to v1.0.48. [thanks Laszlo & Lexikos]
Fixed function definitions to work properly inside a block. [thanks rmarko]
Improved performance of A_Index in expressions by treating it as an integer rather than a string.
Improved performance of if var [not] in/contains
. [developed by Lexikos]
Improved ListLines with an option to turn line-logging Off or On. [thanks kenomby & ruespe]
Compatibility: The change most likely to affect backward compatibility is that floating point numbers stored in variables now have higher precision. Scripts that rely on tiny differences in precision would either need to be reviewed and updated, or have their compatibility improved by using SetFormat Float
(e.g. SetFormat, Float, 0.6
) anywhere in the script. SetFormat Float
disables the higher precision, but gives up some of the new, faster floating point performance.
Performance: The main theme of this release is faster performance. Almost all scripts should run faster -- especially those that make heavy use of expressions and integer math/comparisons (which may run up to three times as fast). To achieve the full benefit, a script either should avoid using SetFormat or should use SetFormat's fast mode.
Expressions and function calls are compiled more heavily, making them much faster (especially complex integer expressions, including those with commas).
Binary numbers are cached for variables to avoid conversions to/from strings. This makes numerical operations involving variables much faster.
Literal integers in expressions and math/comparison commands are replaced with binary integers, which makes them faster; e.g. X+5
and if x > 5
.
LOOPs, IFs, and ELSEs that have blocks (braces) are faster due to skipping the opening '{'. A side-effect is that the '{' is omitted from ListLines.
Thread-creation performance is improved, which should help rapid-fire threads in OnMessage(), RegisterCallback(), and GUI events.
When SetFormat, Integer, Hex
is in effect, assigning a literal decimal integer to a variable also converts it to hex. Usually this is only a display issue.
For OnMessage() performance, the message number and HWND arrive as standard numbers rather than appearing unconditionally as hex. Usually this is only a display issue.
To achieve various improvements in performance, scripts now use slightly more memory (proportionate to the number of variables and expressions).
Changed and fixed if var is time
and other uses of YYYYMMDDHHMISS date-time stamps to recognize that months outside the range 1-12 are invalid. [thanks Nick]
Changed and improved dynamic function calling to allow passing more parameters than defined by a function, in which case the parameters are evaluated but discarded. [developed by Lexikos]
Added function IsFunc(), which indicates whether a function may be called dynamically. [developed by Lexikos]
Added the while-loop, which repeats its commands until its expression evaluates to false. [developed by Lexikos]
Added an assume-static mode for functions. [developed by Lexikos]
Added built-in variables A_IsPaused and A_IsCritical. [developed by Lexikos]
Improved NumPut() to support UInt64 like DllCall(). [thanks Sean]
Improved mouse wheel support by adding WheelLeft and WheelRight as hotkeys and supporting them in Send, Click, and related commands. However, WheelLeft/Right has no effect on operating systems older than Windows Vista. [developed by Lexikos]
Upgraded compiled script compressor from UPX 3.00 to 3.03.
Fixed inability to use MsgBox's timeout parameter when the "Text" parameter had an expression containing commas.
Fixed Menu, Delete, Item-that's-a-submenu
not to disrupt the associated submenu. [thanks animeaime & Lexikos]
Fixed the GUI Hotkey control to return usable hotkey names even for dead keys (e.g. "^" instead of Zircumflex). [thanks DerRaphael]
Fixed RegDelete so that it won't delete an entire root key when SubKey is blank. [thanks Icarus]
Fixed registry loops to support subkey names longer than 259 (rare). In prior versions, such subkeys would either be skipped or cause a crash. [thanks Krzysztof Sliwinski & Eggi]
Fixed FileSelectFolder by providing an option to make it compatible with BartPE/WinPE. [thanks markreflex]
Fixed window/control IDs (HWNDs), which in rare cases wrongly started with 0xFFFFFFFF instead of just 0x. [thanks Micahs]
Fixed inability of Send commands to use the Down/Up modifiers with the "}" character. [thanks neovars]
Fixed crash when a function was called concurrently with an optional ByRef parameter omitted by one thread but not omitted by the other. [thanks DeathByNukes]
Fixed Menu, Tray, MainWindow
to enable the menu items in the main window's View menu. [thanks Lexikos]
Added dynamic function calling. [developed by Lexikos]
Fixed the Sort command: 1) fixed the "function" option not to misbehave when it's the last option in the list; 2) fixed the "unique" option so that when the delimiter is CRLF, the last item can be detected as a duplicate even when it doesn't end in CRLF; 3) fixed the "unique" option not to append a trailing delimiter when the last item is a duplicate. [thanks Roland]
Fixed RegExMatch() and RegExReplace() to yield correct results even when Haystack and OutputVar are both the same variable. [thanks Superfraggle]
Fixed inability to pass a parameter that is "a variable to which ClipboardAll has been assigned". [thanks Joy2DWorld & Lexikos]
Updated RegEx/PCRE from 7.0 to 7.4. For a summary of the major changes, see www.pcre.org/news.txt. For full details of every change and fix, see www.pcre.org/changelog.txt.
Added GUI control "Tab2" that fixes rare redrawing problems in the original "Tab" control (e.g. activating a GUI window by clicking on a control's scrollbar). The original Tab control is retained for backward compatibility because "Tab2" puts its Tab control after its contained controls in the tab-key navigation order. [thanks Xander]
Fixed key-up hotkeys like a up::
not to block the pressing of the "a" key unless the hotkey's #IfWin criteria are met. [thanks Roland]
Fixed Round(Var, NegativeNumber)
, which in rare cases was off by 1. [thanks Icarus]
Fixed crash of scripts that end in a syntax error consisting of an orphaned IF-statement (broken by 1.0.47.00). [thanks msgbox of the German forum]
Eliminated the "GetClipboardData" error dialog. Instead, an empty string is retrieved when the data cannot be accessed within the #ClipboardTimeout period. [thanks ManaUser & Sean]
Changed GUI checkboxes and radio buttons to default to "no word-wrap" when no width, height, or CR/LF characters are specified. This solves display issues under certain unusual DPI settings. [thanks Boskoop]
Fixed expressions to allow literal negative hexadecimal numbers that end in "E"; e.g. fn(-0xe). [thanks Laszlo]
Fixed block syntax to allow a function-call immediately to the right of a '}'. [thanks Roland]
Fixed the Number option of Edit controls to properly display a balloon tip when the user types something other than a digit. [thanks tfcahm]
Fixed WM_TIMER not to be blocked unless it's posted to the script's main window. [thanks tfcahm]
Fixed wildcard hotkeys not to acquire tilde behavior when the same hotkey exists in the script with a tilde. [thanks Lexikos]
Fixed declaration initializers not to retain whitespace at the end of literal numbers. Also, they now allow spaces between a closing quote and the next comma. [thanks Hardeep]
Fixed RunAs not to crash or misbehave when a domain is specified. [thanks Markus Frohnmaier]
Changed relational operators to yield integers even when the inputs are floating point; e.g. 1.0 < 2.0
yields 1 vs. 1.0. [thanks Lexikos]
Added support for function libraries, which allow a script to call a function in an external file without having to use #Include.
Added RegisterCallback(), which creates a machine-code address that when called, redirects the call to a function in the script. [developed by Jonathan Rennison (JGR)]
Added NumGet() and NumPut(), which retrieve/store binary numbers with much greater speed than Extract/InsertInteger.
Improved Sort with an option to do custom sorting according to the criteria in a callback function. [thanks Laszlo]
Improved OnMessage() with an option to allow more than one simultaneous thread. [thanks JGR]
Improved Critical with an option to change the message-check interval, which may improve reliability for some usages. [thanks Majkinetor and JGR]
Changed Critical to put SetBatchLines -1 into effect.
Changed the error messages produced by #ErrorStdOut to contain a space before the colon. [thanks Toralf]
Fixed OnMessage() functions that return one of their own local variables to return the number in that variable, not 0.
Fixed potential crashing of built-in variables that access the registry (e.g. A_AppData, A_Desktop, A_MyDocuments, A_ProgramFiles). [thanks Tekl]
Fixed A_UserName (broken by 1.0.46.16).
Fixed Gui, Tab, TabName
when used after a previous Gui Tab
. [thanks Toralf]
Improved SetTimer to treat negative periods as "run only once". [thanks Majkinetor]
Added GuiControlGet Hwnd
, which is a more modular/dynamic way to retrieve a control's HWND. [thanks Majkinetor]
Added built-in variables A_ThisLabel and A_ThisFunc, which contain the names of the currently-executing label/function. [thanks Titan & Majkinetor]
Fixed GuiControl, GuiControlGet, and Gui ListView/TreeView
to support static variables and ByRefs that point to globals/statics. [thanks Peter]
Fixed FileInstall causing the Random command to become non-random in compiled scripts. [thanks Velocity]
Reduced the size of compiled scripts by about 16 KB due to UPX 3.0. [thanks to atnbueno for discovering the optimal command-line switches]
Added the "require administrator" flag to the installer to avoid a warning dialog on Windows Vista. [thanks Roussi Nikolov]
Fixed hotkeys like *x to fire even when x is also a hotkey that is prevented from firing due to #IfWin. [thanks Joy2DWorld & Engunneer]
Improved optional parameters to accept quoted/literal strings as default values.
Improved ByRef parameters with the ability to be optional (i.e. they may accept default values). [thanks Corrupt]
Fixed inability to recognize a literal scientific notation number that begins with 0, such as 0.15e+1. [thanks Laszlo]
Fixed inability to have a function-call as the first item in certain comma-separated expressions. [thanks Majkinetor]
Fixed WinTitles like ahk_id %ControlHwnd%
in ControlGet's FindString/Choice/List, and Control's Add/Delete/Choose. [thanks Freighter & PhiLho]
Improved floating point support to recognize scientific notation; e.g. 1.2e-5 (the decimal point is mandatory). Also improved "SetFormat Float" with an option to output in scientific notation. [thanks Laszlo]
Fixed StringSplit inside assume-local functions so that it creates a local array even when OutputArray0 exists as a global but not a local. [thanks KZ]
Improved ListView's item-changed notification ("I") to indicate via ErrorLevel whether the item has been selected/deselected, focused/unfocused, and/or checked/unchecked. [thanks foom]
Added an additional layer of protection to compiled scripts. It is recommended that scripts containing sensitive data or source code be recompiled with the /NoDecompile switch.
Fixed :=
deep inside expressions when used to assign the result of a recursive function to a local variable (broken by 1.0.46.06). [thanks Laszlo]
Fixed inability to pass certain ternary expressions to ByRef parameters. [thanks Titan]
Fixed GuiControlGet, OutputVar, Pos
so that it doesn't make the OutputVar blank. [thanks PhiLho]
Changed and fixed continuation sections so that the "Comment" option doesn't force the LTrim option into effect. [thanks Titan]
Changed the Terminal Server Awareness flag back to "disabled" on AutoHotkey.exe and compiled scripts. This improves flexibility and backward compatibility (see discussion at forum).
Fixed unreliability of ComSpec and environment variables on Windows 9x (broken by v1.0.46.07). [thanks Loriss]
Changed: When AutoHotkey.exe is launched without a script specified, it will now run (or prompt you to create) the file AutoHotkey.ahk in the My Documents folder. The only exception is when AutoHotkey.ini exists in the working directory, in which case it uses the old behavior of executing that file.
Improved DllCall to support an integer in place of the function name, which is interpreted as the address of the function to call. [thanks Sean]
Fixed crash of illegally-named dynamic variables on the left of an equal-sign assignment (broken by v1.0.45). [thanks PhiLho]
Fixed FileMoveDir's "Option 2" to work properly even when the directory is being both renamed and moved. [thanks bugmenot]
Fixed inability to pass a variable ByRef if that same expression changed it from empty to non-empty (when #NoEnv is absent). [thanks Joy2DWorld]
Changed DllCall's A_LastError to reflect only changes made by the script, not by AutoHotkey itself. [thanks Azerty]
Applied minor fixes and improvements to regular expressions by upgrading from PCRE 6.7 to 7.0. One of the most notable improvements is the `a option, which recognizes any type of newline (namely `r, `n, or `r`n). Similarly, the \R escape sequence means "any single newline of any type". See also: Full PCRE changelog
Changed and fixed all Control commands and StatusBarWait to obey SetTitleMatchMode RegEx as documented.
Changed RegExReplace() to return the original/unaltered string rather than "" when an error occurs.
Changed: Enabled the Terminal Server Awareness flag on AutoHotkey.exe and compiled scripts.
Improved performance when assigning large strings returned from user-defined functions. [thanks Laszlo]
Fixed the Input command to allow named end keys like {F9} to work even when the shift key is being held down (broken by v1.0.45). [thanks Halweg]
Fixed inability of "Gui Show" to focus the GUI window when the tray menu is used both to reload the script and to show the GUI window. [thanks Rnon]
Fixed inability to pass some types of assignments (:=) to a ByRef parameter. [thanks Laszlo]
Fixed inability to pass the result of an assignment (:=) to a ByRef parameter. [thanks Titan]
Fixed ListView's floating point sorting to produce the correct ordering. [thanks oldbrother/Goyyah/Laszlo]
Fixed environment variables to work properly as input variables in various commands such as StringLen and StringReplace (broken by 1.0.44.14). [thanks Camarade_Tux]
NOTE: Although this release has been extensively tested, several low-level enhancements were made. If you have any mission-critical scripts, it is recommended that you retest them and/or wait a few weeks for any bugs to get fixed.
Fixed comma-separated declaration initializers such as local x = 1, y = 2
to work even when immediately below an if/else/loop statement.
Fixed comma-separated expressions so when the leftmost item is an assignment, it will occur before the others rather than after. [thanks Laszlo]
Changed and fixed function-calls so that any changes they make to dynamic variable names, environment variables, and built-in variables (such as Clipboard) are always visible to subsequent parts of the expression that called them.
Changed: When a multi-statement comma is followed immediately by a variable and an equal sign, that equal sign is automatically treated as a := assignment. For example, all of the following are assignments: x:=1, y=2, a=b=c
.
Changed comma-separated expressions to produce the following effects: 1) the leftmost /= operator becomes true divide rather than EnvDiv; 2) blank values are not treated as zero in math expressions (thus they yield blank results).
Improved the performance of expressions by 5 to 20 % (depending on type).
Improved the new assignment operators such as .= to support the Clipboard variable (even in comma-separated expressions).
Improved the .= operator so that it doesn't require a space to its left.
Improved GUI controls to accept static variables as their associated variables (formerly only globals were allowed).
Added option HwndOutputVar to Gui Add
, which stores a control's HWND in OutputVar. [thanks Corrupt & Toralf]
NOTE: Although this release has been extensively tested and is not expected to break any existing scripts, several low-level enhancements were made. If you have any mission-critical scripts, it is recommended that you retest them and/or wait a few weeks for any bugs to get fixed.
Added function SubStr(), which retrieves the specified number of characters at the specified position in a string.
Added assignment operators //=, .=, |=, &=, ^=, >>=, and <<=, which can be used anywhere in expressions. For example, Var .= "abc"
appends the string "abc" to Var's current contents.
Added full support in expressions for the operators :=, ++, --, +=, -=, *=, and /= (formerly, they could be used only as the leftmost operator on a line). All assignment operators (especially ++ and --) behave in a C-like way when their result is used by some other operator.
Added the ternary operator (?:), which is a shorthand replacement for the if-else statement. For example, var := x>y ? 2 : 3
assigns the value 2 if x is greater than y; otherwise it assigns 3.
Added support for comma-separated expressions, which allow a single line to contain multiple assignments, function calls, and other expressions. [thanks PhiLho & Titan]
Improved variable declarations to support initialization on the same line. Note: A static variable's initialization occurs only once, before the script begins executing.
Improved line continuation to support all expression operators. For example, a line that starts with "?" or "+" is automatically appended to the line above it.
Improved performance of operators "." and ".=" to be as fast as the percent-sign method of appending a string.
Improved expressions to allow more types of consecutive unary operators such as !!Var. [thanks Laszlo]
Changed Critical to check messages less often (20 vs. 10 ms), which improves the reliability of frequently-called OnMessage functions. [thanks Majkinetor]
Changed: A variable named simply "?" is no longer valid in expressions due to the new ternary operator.
Fixed hotkeys to support :::
(colon as a hotkey) and : & x
(colon as a hotkey prefix).
Fixed the installer to remove psapi.dll from the AutoHotkey folder (except on Windows NT4). This avoids a conflict with Internet Explorer 7. [thanks to all who reported it]
Fixed crash on Windows 9x when a script doesn't actually run (e.g. due to syntax error) (broken by v1.0.45). [thanks rogerg]
Changed Control Style|ExStyle
to report ErrorLevel 0 vs. 1 when the requested style change wasn't necessary because it was already in effect.
Improved #Include to support %A_AppData% and %A_AppDataCommon%. [thanks Tekl]
Fixed file-pattern loops not to crash when recursing into paths longer than 259 characters. In addition, such paths and files are now ignored (skipped over) by file-pattern loops, FileSetAttrib, and FileSetTime. [thanks PhilR]
Fixed functions that call themselves and assign the result to one of their own locals (broken by v1.0.45). [thanks bjennings]
Fixed crash of scripts containing regular expressions that have compile errors. [thanks PhiLho]
Fixed GuiControl not to convert checkboxes into 3-state unless requested. [thanks JBensimon]
Changed UrlDownloadToFile to announce a user-agent of "AutoHotkey" to the server rather than a blank string. [thanks jaco0646]
Improved continuation sections to support semicolon comments inside the section via the option-word Comments.
Fixed StringUpper and StringLower to work when OutputVar is the clipboard (broken by v1.0.45). [thanks songsoverruins]
Fixed the hotkeys ~Alt, ~Control, and ~Shift to fire upon press-down rather than release (broken by v1.0.44).
Background: Without the tilde, Alt/Control/Shift fire upon release to avoid taking over both the left and right key. But a specific left/right hotkey like LAlt or RShift fires upon press-down.
Fixed FileReadLine and FileSelectFile not to crash or misbehave when other threads interrupt them (broken by v1.0.45). [thanks toralf]
Fixed RegExMatch() so that when there's no match, named subpatterns are properly set to "" in the output array. [thanks PhiLho]
Fixed RegExMatch()'s "J" option to properly write duplicate named subpatterns to the output array. [thanks PhiLho]
Changed SetWorkingDir and #Include DirName to succeed even for a root directory such as C: that lacks a backslash.
Improved DllCall() to display a warning dialog if the called function writes to a variable of zero capacity.
Note: Although this release has been extensively tested and is not expected to break any existing scripts, several low-level performance enhancements were made. If you have any mission-critical scripts, it is recommended that you retest them and/or wait a few weeks for any bugs to get fixed.
Added support for regular expressions via RegExMatch(), RegExReplace(), and SetTitleMatchMode RegEx. [thanks Philip Hazel & PhiLho]
Improved performance and memory utilization of StringReplace.
Improved performance of the colon-equal operator (:=) for expressions and functions involving long strings.
Improved ControlClick with a new option "NA" that avoids activating the target window (this mode also improves reliability in some cases). In addition, it's been documented that SetControlDelay -1 can improve the reliability of ControlClick in some cases. [thanks nnesori]
Changed GUI buttons to default to "no word-wrap" when no width, height, or CR/LF characters were specified. This may solve button display issues under some desktop themes.
Fixed "Transform HTML" for the following characters: &`n><
Fixed misinterpretation of lines starting with "if not is" such as "if not IsDone".
Fixed inability of "Gui Show" to move a window vertically downward to where its bottommost row of pixels is now.
Fixed inability to use GroupActivate as the only line beneath an IF or ELSE.
Fixed inability of the Input command to differentiate between end keys enclosed in braces and their (un)shifted counterparts; e.g. '{' vs. '['. [thanks Laszlo]
Note: Although this release has been extensively tested and is not expected to break any existing scripts, several low-level performance enhancements were made. If you have any mission-critical scripts, it is recommended that you retest them and/or wait a few weeks for any bugs to get fixed.
Fixed loop-variables like A_Index when accessed in more than one of a line's parameters. The inaccuracy occurred only when one of those parameters called a function that returned directly from the body of a loop. [thanks NumEric]
Changed ListVars to display ByRef parameters by their own name rather than the caller's.
Changed the Input command to do nothing on Windows 9x (not even setting ErrorLevel and OutputVar).
Raised the limit on the number of GUI fonts from 100 to 200. [thanks philou]
Changed StrLen()/StringLen and internal string-handling to avoid calculating a string's length when possible. Although this enhances performance (especially for large strings), scripts that use DllCall to pass a string via the address operator (&) rather than as a str parameter should call VarSetCapacity(Var, -1) to correct the internally-stored length (if it changed).
Improved performance slightly (above and beyond the StrLen improvement).
Fixed ControlGetPos and ControlMove to work with ahk_id %ControlHWND%
. [thanks Hardeep]
Fixed #CommentFlag to affect the line beneath it the same way as other lines. [thanks PhiLho]
Changed A_OSVersion to report Windows Vista as "WIN_VISTA" rather than "".
Added options to set min/max size of GUI windows; for example: Gui +MinSize320x240 +MaxSize640x480
Fixed timers interfering with double-clicks in FileSelectFile. [thanks DJAnonimo]
Fixed mouse hook causing a delay when pressing a GUI window's title bar buttons. [thanks Tekl]
Improved GUI windows to have CS_DBLCLKS so that OnMessage() can monitor double clicks via WM_LBUTTONDBLCLK, WM_RBUTTONDBLCLK, and WM_MBUTTONDBLCLK. [thanks Hardeep]
Improved ListViews to support logical sorting, which treats digits as numbers rather than mere characters. [thanks Tekl & Hacker]
Fixed FileSelectFolder and TreeView to respond properly to mouse clicks when timers are running.
Fixed inability of OnMessage() to consistently monitor certain messages such as WM_NOTIFY. [thanks numEric]
Fixed inability of literal/quoted strings to contain `%
.
Fixed continuation sections to support #EscapeChar, #DerefChar, and #Delimiter. [thanks Laszlo]
Changed GroupBox to default to "no word-wrapping". This can be overridden via +Wrap
.
Changed/improved the ** operator and Transform Pow to support negative bases when the exponent isn't fractional. [thanks Laszlo]
Improved GUI responsiveness during UrlDownloadToFile (especially for slow downloads).
Fixed OnMessage() when called from inside a monitor function for the purpose of disabling some other monitor. [thanks Hardeep]
Changed/fixed ImageSearch's TransN option to use RGB vs. BGR as documented. [thanks Tom Lorimor]
Changed the installer to omit the "Run" verb for .ahk files. The "Open" verb is now the default (with a new display-name of "Run Script"). [thanks numEric]
Fixed hook hotkeys like $^b not to fire twice when a similar, key-up hotkey exists (like #b up
). [thanks Newbie]
Fixed one too many backspaces in asterisk hotstrings whose next-to-last character is a dead key. [thanks Henrique]
Fixed Gui Color to work after the background color was previously changed to "default". [thanks Hardeep]
Changed if var is xdigit
to tolerate a 0x prefix. [thanks Titan]
Added command Gui +LabelMyGui to support custom label names (e.g. "MyGuiClose" instead of "2GuiClose"). This also allows multiple GUI windows to share the same set of labels. [thanks Tekl]
Fixed Gui Show not to unmaximize a window unless the options require it. [thanks foom]
Fixed GuiControl's +/-Left/Right for buttons, checkboxes, and radios. [thanks Hardeep]
Fixed UpDown creation to widen its buddy only when the buddy had no explicit width. [thanks Thalon]
Improved MsgBox/IfMsgBox to support Cancel/Try Again/Continue, as well as a Help button. [thanks jballi]
Fixed stack overflow when a registry loop traverses deeply nested subkeys. [thanks Eggi]
Fixed Hotkey command to report ErrorLevel 0 vs. 51 upon success for joystick hotkeys. [thanks Roland]
Changed ClipboardAll to exclude formats that cause Outlook's MS Word editor to display error dialogs. [thanks deanhill1971]
Changed and improved UrlDownloadToFile to retrieve the file from the remote server vs. the cache. There is a new option to override this. [thanks olfen]
Improved remapping to support destination characters that don't exist on the keyboard (such as F1::ð
in English). [thanks DavidT]
Fixed remapping-to-modifier such as F1::Control
(broken by v1.0.44.05). [thanks formarx]
Fixed mouse movement being off by 1 pixel for coordinates very near 0 (broken by v1.0.43). [thanks numEric]
Changed and improved remapping-to-modifier (such as F1::Control
) to release the modifier during the script's other uses of Send.
Fixed double-colon warning dialog appearing upon launch of certain scripts. (broken by v1.0.44.03)
Fixed combination hotkeys like a & b
to work even if b & a
and b & a up
are also present.
Fixed buddyless UpDown controls to work even if a StatusBar is present. [thanks Titan]
Fixed FileExist() to report "X" rather than "" for files whose attributes are all undefined. [thanks Peter]
Fixed Tab controls so that the first Text control added to a new page is auto-positioned correctly even if the previously added control was a Text control on some other page.
Fixed ImageSearch so that a transparent color like TransBlack is as effective in variation mode as non-variation mode. [thanks Troz]
Fixed GetKeyState and KeyWait to accept characters that don't exist in the current keyboard layout (in case the keyboard layout changes after launching the script).
Fixed hotkeys that don't exist in the current keyboard layout (such as ^!ä::
in English) to display a warning and end the auto-execute section. [thanks Androgen Belkin]
Changed and improved ControlSend, Send, Hotstrings, Input, and AltGr handling to use the target window's language rather than the script's. If you use only one keyboard layout on your system, this should not affect anything. [thanks Androgen Belkin]
Improved VarSetCapacity() to interpret a capacity of -1 as "update this variable's internally-stored length". This is useful in cases where a variable has been altered indirectly, such as by passing its address via DllCall().
Fixed hotkeys that use &
and ~
together (e.g. ~a & b
and ~LButton & RButton
) (broken by v1.0.44). [thanks SlimlinE & Spike]
Fixed StatusBar's grabbing of UpDowns that are added after it. [thanks Tekl]
Changed Round() to display exactly N decimal places rather than obeying SetFormat.
Fixed OnClipboardChange to work even when the script is displaying a MsgBox or other dialog.
Fixed FileCreateDir not to report ErrorLevel 1 when the specified directory ends in \
. [thanks Wesley]
Fixed hotkeys Control::
, Shift::
, and Alt::
to fire on release of the key rather than press-down (broken by v1.0.41).
Fixed loading of icon #1 from nonstandard file types such as .bin.
Fixed ListView creation to obey the text color set by Gui Font.
Changed and fixed the hotkey tilde prefix (~) so that hotkeys like ~Esc and Esc are considered duplicates; that is, a script cannot define both ~Esc and Esc unless they are under different #IfWin criteria (in which case ~Esc and Esc have been fixed to work properly). [thanks jballi]
Changed and improved ListViews: 1) a new option WantF2 is in effect by default, which causes an F2 keystroke to edit the current row (when not ReadOnly); 2) added LV_Modify(Row, "Vis")
to scroll an item into view; 3) drag notifications occur even without AltSubmit; 4) item-change notifications have A_EventInfo set to the row number; 5) ErrorLevel no longer mirrors A_EventInfo in cases where it was never documented to do so (same for GuiContextMenu).
Improved Edit controls to select all text in response to Ctrl+A. This can be disabled via -WantCtrlA
.
Added new GUI control types TreeView and StatusBar.
Fixed %A_WorkingDir% on Windows 9x, which was sometimes blank. [thanks Points]
Improved BlockInput with a new mode that blocks only physical movement of the mouse, not keystrokes or mouse clicks.
Improved PixelGetColor with two alternate modes that work in a broader variety of windows and full-screen apps. [thanks TDMedia]
Improved StringMid to allow Count to be omitted to retrieve all characters. [thanks kapege.de]
Improved FileSelectFile to support special folders such as My Computer via CLSID strings (FileSelectFolder and Run already support them).
Fixed SendInput not to revert to SendEvent merely because another script has a mouse hook. Only another keyboard hook should do that. [thanks baby-luck]
Fixed LV_GetCount() to work even if the "C" in its name is lowercase.
Changed FileSelectFile to navigate/follow shortcuts (.lnk files) rather than selecting them. There is also a new option to override this. [thanks Veovis & PhiLho]
Added Gui +LastFoundExist to detect the existence of a GUI window. [thanks Tekl & Evl]
Added built-in variables A_AppData, A_AppDataCommon, and A_Temp (A_Temp is the folder designated to hold temporary files).
Changed SendInput to use SetKeyDelay -1, 0
when it reverts to SendEvent mode (unless SendEvent's KeyDelay is -1,-1
, in which case -1,-1
is used).
Added directive #NoEnv, which is recommended for all new scripts because:
Added built-in variables ComSpec and ProgramFiles to ease the transition to #NoEnv.
Added command EnvGet, which retrieves an environment variable.
Fixed inability of Menu, Tray, Icon
to load icon #1 from file types cpl/scr/drv/ocx/vbx/acm/bpl (broken by v1.0.43.03). Similarly, all icon-capable features have been improved to support these file types. [thanks Winkie & PhiLho]
Fixed the following legacy commands to accept function-calls containing commas: EnvAdd/Sub, LeftClick(Drag), RightClick(Drag). [thanks Titan]
Changed ahk_id to operate directly on the specified HWND when it's a control (child). Previously, it operated upon the topmost sub-control if that control had any sub-controls.
Improved Post/SendMessage to fully support strings put into address variables by the receiver (e.g. PostMessage, Msg, &MyVar
).
Improved support for control HWND as an alternative to control ClassNN: 1) Added a MouseGetPos option to retrieve control HWND; 2) Added WinGet ControlListHwnd to retrieve a list of control HWNDs; 3) Added ControlGet Hwnd to retrieve the HWND that corresponds to a control's ClassNN or text.
Added GuiControlGet FocusV, which gets the focused control's variable name rather than its ClassNN.
Fixed and improved support for .ICL files (icon libraries), which was broken by v1.0.43.03. [thanks Tekl]
Changed case sensitivity in hotkey names back to pre-1.0.43.03 behavior: high ANSI letters like Ä and Ü are treated as different hotkeys than their lowercase counterparts. [thanks copa017]
Fixed crash of characters above Chr(127) in hotstring abbreviations and the locale-search-from-right mode of InStr() and StringGetPos (broken by v1.0.43.03). [thanks PhiLho & brotherS]
Fixed distortion of 16x16 icons loaded via ahk2exe or Menu, Tray, Icon
. [thanks Tekl]
Fixed the following to ignore #MaxMem as documented: VarSetCapacity(), FileRead, ClipboardAll, and ControlGet (ListView). [thanks Dippy46]
Changed the following to use locale case insensitivity vs. "A-Z only" insensitivity: hotkey names, hotstring abbreviations, menu names, Input's MatchList, and Gui Tab.
Changed the expression equal operator (=) and the case-insensitive InStr() to use locale case insensitivity when StringCaseSense is Locale or On.
Improved StringCaseSense with a new option Locale that makes string comparisons case-insensitive according to the rules of the current user's locale. For example, most English and Western European locales treat the letters A-Z and ANSI letters like Ä and Ü as identical to their lowercase counterparts. [thanks Boskoop & PhiLho]
Improved the Sort command and ListView sorting with a locale-case-insensitive option.
Improved mouse wheel hotkeys (WheelDown/Up) to report the number of wheel turns in A_EventInfo, which allows distinguishing between fast and slow wheel movement. [thanks evl]
Improved FileRead with an option to read only the leading part of a file. [thanks Dippy46]
Fixed raw-mode hotstrings not to send the extra string {Raw} (broken by v1.0.43). [thanks stom2006]
Changed SendMode: 1) renamed InputThenEvent to Input; 2) added InputThenPlay, which is the same behavior as the former "Input". This was done because SendEvent is less likely to cause compatibility problems than SendPlay.
Fixed mouse clicking at unspecified coordinates in particular apps; e.g. Send {LButton}
(broken by v1.0.43). [thanks incith]
Fixed tilde hotkeys so that if they remove a hook, their own key doesn't get stuck down (e.g. Mouse Gestures script and ~LCtrl::Hotkey, RButton, Off
). [thanks Stefan Taubenberger]
Note: Although this release has been extensively tested and is not expected to break any existing scripts, several changes were made to the sending of keystrokes and mouse clicks. If you have any mission-critical scripts that rely on such features, it is recommended that they be re-tested or that you wait two weeks for any bugs to get fixed.
Fixed AltGr hotkeys that use Send, such as <^>!m::Send ^c
. Also fixed AltGr remappings such as F1::RAlt
[thanks foxer]
Fixed inability of VarSetCapacity to free the memory of a ByRef parameter. [thanks Corrupt]
Fixed hotstring option b0 to show the ending character where you typed it rather than at the end of the replacement.
Improved the speed and reliability of auto-replace hotstrings by defaulting them to SendInput mode. There is also a new hotstring option to change the sending mode.
Improved the reliability of mouse clicks/drags in cases where the user is physically moving the mouse during the event.
Added commands Click and Send {Click}, which are easier to use than MouseClick. They also compensate if the left/right mouse buttons have been swapped via the control panel.
Added command SendMode, which makes Send synonymous with SendInput or SendPlay rather than the default (SendEvent). It also makes Click and MouseMove/Click/Drag use the specified method.
Added two new methods for sending keystrokes and mouse clicks: SendInput and SendPlay. These are generally faster and more reliable. Also, SendPlay allows keystrokes and hotstrings to be accepted by a broader variety of games.
Fixed crash of functions that recursively pass ByRef parameters. [thanks PhiLho]
Fixed crash of A_ScriptDir (broken by v1.0.42.01).
Fixed Run/RunWait's passing of an extra space character at the end of the parameter list when launching shortcuts. [thanks arbe]
This is functionally identical to the previous release, whose EXE and BIN were about 1% larger than they should have been due to a compiler quirk.
Fixed ClipboardAll when used with apps such as Word and Excel (broken by previous version). [thanks Roussi Nikolov]
Fixed ClipboardAll to prevent appearance of bookmarks in MS Word. [thanks Laszlo & 02clams]
Fixed A_TimeIdlePhysical being disrupted by simulated AltGr keystrokes. [thanks skrommel]
Fixed Send {Blind} causing sticking Win/Ctrl/Alt/Shift when the user released such a key in the middle of a Send.
Improved the Send command not to press and release the shift key after each uppercase letter (e.g. Send ABC
).
Improved SoundSet/Get to support ComponentType "Headphones". [thanks Tobias Winkler]
Fixed crash of WinActivate in certain rare circumstances. [thanks twhyman]
Changed hotstrings to require the mouse hook by default (see next item). This can be prevented via #Hotstring NoMouse.
Improved hotstrings to take into account mouse clicks. This allows a hotstring to fire when the user's click focuses a new control or moves the caret.
Improved the Random command with a means to set a new seed. [thanks Laszlo]
Improved #ClipboardTimeout to reattempt data reading when the first attempt fails. Previously, only the opening of the clipboard was reattempted.
Added built-in variable A_LastError for DllCall and Run/RunWait. It contains the result from the OS's GetLastError().
Fixed UpDown controls to snap onto the right control when inside a Tab control that contains a ListView. [thanks Thalon]
Improved the Hotkey command with an "Off" option (typically used to create a hotkey in an initially-disabled state).
Improved A_Cursor not to interfere with double-clicking. [thanks Shimanov]
Fixed the following variables to work correctly when concatenated onto other strings: A_DetectHiddenWindows, A_DetectHiddenText, A_AutoTrim, and A_StringCaseSense. [thanks jballi]
Fixed KeyWait and GetKeyState in the subroutines of hook hotkeys (broken by v1.0.39) [thanks Laszlo & TobStro]. For example:
~LControl:: if not GetKeyState("LControl") ToolTip LControl is not down as expected (this bug affected some systems but not others). return
Fixed expressions such as "If not Installed" not to be misinterpreted as "If not in List". [thanks Toralf]
Fixed certain unusual situations where a hotkey would unnecessarily require the keyboard hook.
Fixed vkNNN hotkeys to be handled by the hook when that VK is also used as a prefix for other hotkeys.
Fixed #IfWin's automatic disabling of prefix keys to work properly when Suspend is ON.
Fixed minor hotkey issues on Windows 95/98/Me: 1) The wildcard prefix (*) is ignored and such hotkeys are put into effect rather than being disabled; 2) Non-wildcard hotkeys that are a subset of a wildcard hotkey are put into effect rather than being disabled; 3) A left/right hotkey such as >#x::
is put into effect as Win+X rather than simply X.
Changed the Hotkey command to create a new variant (when appropriate) rather than always updating any existing hotkey of that name. This only affects scripts that use v1.0.41's #IfWin directive.
Changed hotkeys to recognize ^!c
as being the same as !^c
(different symbol order). This also affects the Hotkey command.
Improved the Hotkey command to support UseErrorLevel and context-sensitive hotkeys (via Hotkey IfWinActive/Exist).
Improved #IfWinActive/Exist to support Windows 9x. In addition, the keyboard hook is now avoided whenever possible. Finally, #IfWin now sets the Last Found Window.
Improved the following commands to support TListBox/TComboBox and possibly others: Control (Add/Delete/Choose/ChooseString); and ControlGet (FindString/Choice/List).
Added support for hotkey and hotstring variants (duplicates). Such hotkeys perform a different action (or none at all) depending on the type of window that is active or exists.
Changed GuiControl Move to reduce flickering when resizing or moving controls [thanks Serenity]. However, this may cause painting artifacts for some control types under certain circumstances. If so, please update your scripts to use GuiControl MoveDraw instead.
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]
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 make selected hotkeys and hotstrings active only in the windows you specify.
Fixed memory leak when GuiControl loaded some types of images into a Picture control. [thanks beardboy]
Fixed inability of ToolTip to reappear after it was destroyed externally via Alt+F4, WinClose, etc
Fixed GuiControl, %Var%
when Var is blank or contains only a window number. It now updates the control's contents rather than doing nothing. [thanks MisterW]
Scripts in UTF-8 format can now be loaded (BOM bytes "EF BB BF" at start of file). [thanks D. J. Rausch]
Improved ImageSearch and the fast-mode PixelSearch to support 256-color screens (8-bit).
Fixed hotkeys such as ^q::
to trigger the "*q up" hotkey upon release instead of the ^q hotkey a second time.
Fixed ComboBoxes to yield the proper selection when: 1) GuiControl altered the Edit field; or 2) the user manually typed a matching item into an AltSubmit ComboBox. [thanks Tekl]
Fixed memory leak when a script called a function recursively. [thanks Laszlo]
Fixed crash of Abs() when called with an empty string. [thanks Laszlo]
Fixed the number -0x8000000000000000 in expressions. [thanks Laszlo]
Fixed Ceil(), Floor(), and Transform Ceil/Floor to give the correct answers for all inputs. [thanks Litmus Red]
Fixed remapping so that Enter can be a destination key. [thanks jocamero]
Changed ahk_id to work on hidden child windows (controls) without the need for DetectHiddenWindows.
Improved Post/SendMessage to accept quoted/literal strings for wParam/lParam.
Fixed WinGetText and ControlGetText to work on apps that respond incorrectly to WM_GETTEXT (such as AIM). [thanks Yarbuck]
Changed the program to align all data on 32-bit boundaries, which solves DllCall structure issues. [thanks Shimanov]
Because some other solution is necessary, the 1-pixel increase for Checkboxes and Radio Buttons in v1.0.40.01 has been undone.
Fixed Transform Unicode to be able to produce a Unicode string whose first byte is zero. [thanks Shimanov & Laudrin]
Reduced the size of compiled scripts by 20 KB by having the compiler minimize code size in sections that don't affect script performance.
Fixed the title bars of script-owned windows to respond correctly to left and right down-clicks generated by the script's own hotkeys. [thanks Shimanov]
Fixed inability of OnMessage to consistently monitor certain messages such as WM_GETMINMAXINFO.
Changed Critical to be temporarily off during MsgBox and other dialogs.
Added sub-command Thread NoTimers, which prevents a thread from being interrupted by timers.
Changes for GUI:
Fixed GuiContextMenu's A_GuiControl to be accurate for Text and Picture controls inside a GroupBox or Tab control.
Fixed GuiControl to properly redraw Picture controls and transparent Text controls when they are given new contents.
Increased the width of auto-sized Checkboxes and Radio Buttons by 1 pixel to prevent wrapping on certain desktop themes.
Fixed the v1.0.39 mouse and keyboard hooks so that failure to activate them behaves correctly.
Changed the Send command for Russian and other keyboard layouts to be able to produce more ASCII characters (such as the letters A to Z). This does not affect most Western European and English layouts.
Changed hotkeys that are a subset of a wildcard hotkey to take precedence. For example, if *x and ^x are both hotkeys, pressing ^x will now trigger ^x rather than *x.
Improved syntax so that double colons do not need to be escaped.
Improved Send and ControlSend with option {Blind}, which leaves Ctrl/Alt/Shift/Win pressed down if they started that way.
Added a new remapping method that is more simple and powerful than the old methods. For example:
a::b ; Make the "a" key become "b". CapsLock::Ctrl ; Make CapsLock become a Control key. XButton1::LButton ; Make the fourth mouse button behave like the left mouse button. RCtrl::RWin ; Make the right Control key become the right Windows key.
Note: The last change below may impact scripts that use the keyboard or mouse hook. If you have any mission-critical scripts that rely on them, it is recommended that they be re-tested or that you wait two weeks for any bugs to get fixed.
Fixed inability to have lines consisting entirely of spaces and tabs in continuation sections. [thanks JSLover]
Fixed hotkeys such as LButton & LCtrl::
to auto-install the mouse hook. [thanks JSLover]
Added a dedicated thread to service the keyboard and mouse hooks. This eliminates mouse/keyboard lag during long operations such as UrlDownloadToFile. It also prevents keys from getting "stuck down". The new thread consumes only 36 KB of memory and it exists only in scripts that use the hooks.
Note: Some optimizations were made to the keyboard and mouse hooks. If you have any mission-critical scripts that rely on them, it is recommended that they be re-tested or that you wait two weeks for any bugs to get fixed.
Fixed continuation lines that start with "AND" and "OR" to work even when the next character is in the set ()!~*&-+
. [thanks Decarlo110]
Fixed hotkeys/labels such as (::
and (MyLabel):
not to be misinterpreted as continuation sections. [thanks whismerhill]
Fixed Menu Show (broken in the previous version) to call the selected menu item's subroutine prior to executing the command beneath Menu Show. [thanks Roussi]
Changed Sleep -1 and Sleep 0 to check the message queue on Windows 9x as they do on other operating systems.
Fixed hotstring reset option (Z), which could crash a script. [thanks arbe]
Improved threads to reduce the chance of an interruption occurring before even a single line can execute. [thanks Paul Haines]
Added command Critical, which prevents the current thread from being interrupted by other threads. It also buffers incoming events until the critical thread ends.
Fixed key-up hotkeys so that having both a wildcard and a non-wildcard version of the same hotkey works even when the non-wildcard down-hotkey is defined before the non-wildcard up-hotkey. [thanks Paul Haines]
Improved Edit controls with the option "WantTab", which allows the tab keystroke to produce a tab character.
Fixed inability of WinSet Region to accept a negative X-coordinate.
Fixed radio buttons to start a new radio group for each new Tab control or page. [thanks Toralf]
Changed VK hotkeys such as ^VK24::
to avoid the use of the keyboard hook when possible. As a side-effect, such hotkeys are now triggered by any key that has the specified virtual key (e.g. both Home and NumpadHome for VK24). [thanks Orion]
Improved the Hotkey command with option "On" to change a hotkey's label and enable it in one step. [thanks Toralf]
Improved "GuiControl Disable/Enable/Hide/Show" to recognize an optional 1 or 0 suffix to simplify scripts. [thanks Toralf]
Fixed GuiContextMenu's A_GuiControl to be non-blank when the user right-clicks a Text, Picture, or Tab control.
Changed OnMessage() to receive LPARAM as an unsigned vs. signed number.
Fixed the Input command to properly capture keystrokes sent by a hotkey or hotstring for which the user is physically holding down Shift, Ctrl, Alt, or Win. [thanks wildfire]
Changed GuiControl Text to set the text of a ComboBox's Edit control rather than new choices for its drop-list. Please update your scripts accordingly.
Improved FileMoveDir with an option to unconditionally overwrite the target folder.
Added built-in function IsLabel(), which verifies that a label exists before you gosub it. [thanks Tekl]
Added built-in function OnMessage(), which can receive custom messages and monitor system messages.
Added a WinLIRC client script that responds to signals from a hand-held remote control. WinLIRC is an open-source utility that captures infrared signals from virtually any brand of remote control.
Fixed disruption of a GUI window's custom icon when Menu, Tray, Icon
loads a new icon. [thanks Tekl]
Fixed hotstring option "O" (omit end-char) to work even when "B0" (no-backspace) is in effect. [thanks Tekl]
Improved AltTab hotkeys to support Esc as a means of canceling the operation. [thanks catweazle]
Fixed auto-replace wildcard hotstrings whose last character is produced via dead key (e.g. :*:jsá::
). [thanks jordi]
Fixed the tray icon to turn green when a paused thread is interrupted by a new thread.
Changed and improved the Pause command: 1) Pause Off
always affects the thread immediately beneath the current thread rather than the nearest paused thread; 2) Pause Toggle
and Pause
always pauses the current thread if the thread beneath it is unpaused; 3) Added an option to pause the underlying thread rather than the current thread. [thanks Decarlo110]
Improved the "Pause Script" menu item to work even when the script is idle (which prevents timers from running). [thanks Rajat]
Improved SoundSet and SoundGet to support N/A for ComponentType and numeric values for ControlType. There is also an example script to discover your soundcard's capabilities.
Fixed hotkeys such as ^!a::
not to fire twice when a & b::
is a hotkey. Also fixed hotkeys such as ^!a::
to work without a $
when "a" is a prefix key such as a & b::
. [thanks t0nyk0]
Fixed hotkeys LButton::
and RButton::
not to disrupt Edit control context menus. [thanks Tekl]
Fixed GuiControl ChooseString not to ignore the first two items in each ListBox/ComboBox/DDL. [thanks Tekl]
Fixed serious bugs introduced by the previous version in the Send command and other keyboard features.
Fixed minor issues when a script's language/layout changes while it's running. This affects hotkeys, hotstrings, Send, and possibly other areas.
Fixed the Hotkey control for NumLock and NumpadDiv (previously it yielded SC145 and SC135).
Improved Gui Tab with an exact-match mode. [thanks Tekl]
Improved hotkeys to recognize the following symbols as valid key names: #!^+$<>*~
[thanks Tekl]
Fixed key-up hotkeys such as LButton Up::
to avoid disruption of non-hotkey events such as Shift+LeftClick. [thanks Icfu]
Fixed ControlGet List for ListViews in List/Icon view. [thanks Rajat]
Fixed inability of WinGetText and WinGet ControlList to output to Clipboard.
Fixed inability to retrieve Clipboard more than once in the same line.
Fixed LV_ModifyCol() to accept floating point column widths. [thanks Toralf]
Improved StatusBarWait to continue waiting even if the bar becomes temporarily unresponsive.
Improved ControlGet List with the ability to get text and other info from ListViews such as Explorer.
Fixed tilde key-up hotkeys for Win/Alt such as ~LWin up::
.
Fixed bitwise-not of a floating point value such as ~1.0
.
Improved VarSetCapacity with the ability to zero-fill a variable's memory.
Improved DllCall by adding Gdi32.dll to the set of default DLLs.
Added operators & and * for use with memory addresses and binary data.
Added documentation to DllCall demonstrating how to use structures.
Fixed AltGr issues: 1) Inability of Send command to produce uppercase AltGr characters (introduced in v1.0.35); 2) Sticking control key for hotkeys such as ^!t::Send a
when fired via AltGr; 3) Possibly other AltGr issues. [thanks Henrique Peron]
Fixed ListView drawing problems when inside a Tab control. [thanks beardboy]
Fixed ToolTip, which was broken in v1.0.36.03 for operating systems older than XP.
For ListViews: 1) Fixed the inability to switch out of tile mode; 2) The "H" (HotTrack) event is no longer received because its high frequency interfered with a script's processing of more important events. [thanks Toralf]
Improved FileSelectFolder to support a starting folder that doesn't restrict upward navigation.
Improved SetTimer to support an interval of up to 49.7 days rather than the previous 24.8. [thanks MIchael]
Changes for GUI:
Fixed AltSubmit ListView's disruption of context menu.
Fixed LV_ModifyCol()'s auto-sizing to have no effect when not in report view (avoids traumatizing the ListView). [thanks Toralf]
Improved ListViews: 1) A_EventInfo contains the focused row for more types of events; 2) LV_GetCount("Col")
retrieves the number of columns; 3) Added "Tile" as a large-icon viewing mode (XP only). [thanks Toralf]
Fixed hotstrings to work when the script is displaying an input box.
Fixed tilde key-up hotkeys such as ~5 up::
to avoid double-character output.
Disallowed linefeeds (`n) and other invisible characters in variable names.
Increased the stack limit from 1 to 4 MB, which allows functions and subroutines to recurse more deeply. Note: This does not increase the memory used by a typical script. [thanks Rubens]
Doubled the speed of accessing empty variables (which are slow due to the need to check if they're environment variables).
Improved all windowing commands to support multiple criteria (such as title+class) to narrow down the search.
Added built-in variable A_LoopFileExt, which contains the loop file's extension.
Fixed FileCopy and FileMove to avoid deleting a file that is copied/moved onto itself. In such a case, FileCopy still counts it as a failure but FileMove now counts it as a success. [thanks mario_a]
Fixed continuation sections so that accents and commas after the word Join don't change the behavior of accents and commas in the section. [thanks Nemroth]
Added WinSet Top, which attempts to bring a window to the top of the stack without activating it. [thanks catweazle]
Fixed double syntax error for a bad function call in a block.
Improved Process Exist to fetch the script's own PID when no other parameters are given. [thanks Junyx]
Changes for GUI:
Added GuiContextMenu, which facilitates the display of custom Gui context menus.
Added Gui +Delimiter`n as a means to change the separator between fields.
Added A_EventInfo for use by OnClipboardChange, ListBox, GuiSize, and GuiDropFiles.
Added A_GuiEvent as a synonym for A_GuiControlEvent.
Added +/-Redraw as a means to accelerate the filling of a ListBox.
Added new control type ListView, which is a tabular view of rows and columns. It features built-in sorting and support for displaying icons.
Fixed inability of #Include to recognize escaped semicolons in compiled scripts.
Improved popup menus to reactivate the previously active window before allowing the menu thread to start. [thanks thomasl]
Improved popup menus to reactivate the previously active window when the menu is dismissed. [thanks thomasl]
Fixed inability of popup menus to be dismissed via Esc or clicking outside the menu (new bug in v1.0.35.12). [thanks Paulo]
Fixed crash if a compiled script contained certain unusual hotkeys such as End & a::
. [thanks TheLeO]
Fixed script crash when it overrode a built-in function (new bug in v1.0.35.11). [thanks B_fisher]
Fixed IfExist and FileExist() to work on volume names in \\?\Volume{...}
format.
Changed popup menus other than TRAY so that they avoid activating the script's main window.
Improved #Include to be able to set a new working directory for subsequent uses of #Include and FileInstall. In addition, #Include is now able to resolve %A_ScriptDir%. [thanks Dmitry]
Improved FileInstall to always get the file from A_ScriptDir vs. A_WorkingDir when no absolute path is specified.
Fixed Hotstrings and Input so that the user's press of Ctrl+Alt as a substitute for AltGr is not disrupted. [thanks Laszlo]
Fixed A_TimeSinceThisHotkey to not be altered by GUI threads.
Added OnClipboardChange, which is a label launched automatically whenever the clipboard changes. [thanks ApplePie]
Fixed MonthCal and DateTime controls so that a g-label does not interfere with the calendar's arrow buttons. [thanks guivho]
Fixed the sending of AltGr characters so that AltGr's automatic LControl events don't trigger hotkeys. [thanks Laszlo]
Changed the behavior of AltSubmit MonthCal controls to address deficiencies. Please adjust your scripts accordingly.
Fixed the inability of a script's first line to be /*
(broken in 1.0.35.06). [thanks Harmless]
Fixed Control (^) hotkeys that send AltGr characters such as {
in German. (broken in v1.0.35). [thanks Hajos]
Fixed Send on NT4 so that AltGr keys such as \
in French are sent properly (broken in v1.0.35). [thanks Nemroth]
Fixed SetCapsLockState Off
when the OS allows CapsLock to be turned off only via Shift. [thanks Teddy]
Improved line merging: 1) A line starting with .
is automatically appended to the line above it; 2) Comments and blank lines may exist between continuation lines without affecting the merger.
Added directive #LTrim as a means to make multiple continuation sections use the LTrim setting.
Fixed Gui +OwnDialogs to not get turned off by Gui Show and other sub-commands.
Fixed ahk2exe's ignoring of last parameter when /out, /icon, and /pass were all specified. [thanks Rajat]
Fixed expressions so that operators without spaces around them, such as x*y*z
, always produce correct answers. [thanks Mark Kantor]
Fixed the inability to create DateTime and MonthCal controls on an OS older than XP.
Added a new method of breaking up long lines: A line that starts with "and", "or", ||, &&, or a comma is automatically merged with the line directly above it.
Fixed Break/Continue syntax errors and other compiled script bugs introduced in v1.0.35.01. [thanks ranomore]
Fixed GuiControl,, MyRadio|MyCheckbox, NewText
, which was broken in v1.0.35. [thanks ranomore]
Fixed shorthand style if not VarName
so that VarName may start with B, C, I, or N.
Reduced the size of each compiled script by about 5 KB (by means of omitting non-essential syntax checking).
Improved GUI Hotkey control to notify the script of changes via g-label.
Added modal/owned dialogs for GUI windows: MsgBox, InputBox, FileSelectFile, and FileSelectFolder.
Note: Some internal changes were made to the Send command. If any of your scripts rely on the subtle differences between the left, right, and neutral modifiers keys (Control, Alt, Shift, and Win), it is recommended that they be retested prior to adopting this version.
Fixed the Send command's inability to send AltGr characters (such as \
and {
on the German keyboard) to apps that don't allow Ctrl+Alt as a substitute for AltGr. [thanks xrat]
Improved functions to support optional parameters.
GUI:
Fixed Tab controls' g-label to launch when the page is changed via keyboard navigation. Also, controls added to a Tab control while the window is visible are drawn correctly.
Improved Edit controls to support g-labels, which notify the script when an Edit's contents have changed.
Added control types DateTime and MonthCal, which allow a date and/or time to be entered in various formats.
Added control type UpDown, which is a pair of arrow buttons that can be clicked to increase or decrease a value.
Fixed the Suspend and Hotkey commands' inability to disable joystick hotkeys, as well as the inability to enable them in the auto-execute section. [thanks matt911]
Fixed Transform Deref to support a built-in or environment variable that isn't directly referenced elsewhere in the script. [thanks toralf]
Fixed inability to launch the program on Windows 95/NT systems that lack MSIE 3 or later.
Fixed ListLines, which sometimes terminated the listing prematurely.
Fixed multi-line Edit controls so that pressing Esc in them does not close a non-GuiEscape window. [thanks Rajat]
Fixed the hotkeys #LAlt::
and #RAlt::
to prevent appearance of the Start Menu. [thanks Dmitry Lyudmirsky]
Fixed GuiControl so that reloading a Picture control inside a Tab control redraws properly. [thanks hanspeter]
Fixed VarSetCapacity() when called inside an expression.
Improved DllCall so that the "A" suffix on something like MessageBoxA can be omitted even when the DLL name is explicitly specified. In addition, the letter P may be used in place of * so that the quotes can be omitted around all types. [thanks Jerry]
Added floor division operator //
for high performance integer division.
Added built-in functions Abs, ACos, Asc, ASin, ATan, Ceil, Chr, Cos, Exp, FileExist, Floor, GetKeyState, InStr, Ln, Log, Mod, Round, Sin, Sqrt, Tan, and StrLen.
Fixed sporadic inability of GuiControl to change the default button or a button's style. Also fixed a possible crash when GuiControl established a default button when there wasn't one previously. [thanks hanspeter]
Improved DllCall so that arg types that don't contain an asterisk/space don't need to be enclosed in quotes.
Added sub-command Gui Margin to override a window's default margin.
Fixed inability of IfMsgBox to detect a timeout for a MsgBox that contains only an OK button. [thanks Mats]
Added function VarSetCapacity(), which enlarges or shrinks a variable.
Added function DllCall(), which calls a function inside a DLL. [code by Marcus Sonntag (Ultra)]
Improved #Include: The file name may be preceded by *i
and a single space to ignore any file errors. [thanks Tekl]
Added +/-Theme as a per-control option (GUI). This can also be used to create a themed Tab control. [thanks Titan]
Added a method to break up long lines into several smaller ones. This is especially useful for hotstrings and FileAppend. See line continuation. [thanks various]
Fixed the inability of WinSet Region to properly restore the original region, which prevented maximize from working. [thanks AntonyB & Skrommel]
ImageSearch is now much more useful: 1) Icons are supported (even ones containing transparent sections); 2) PNG, TIF, ICO, and other image formats are supported; 3) Approximate images may be found by allowing the image's colors to vary by a specified amount; 4) Matching is a little more lenient because the mystery-byte of each pixel color is ignored. [thanks Aurelian Maga]
Fixed A_Index, A_LoopFileName, and similar variables when used in more than one parameter of a command that calls functions. In addition, a function may now access the caller's contents of these variables. [thanks corrupt]
Fixed inaccurate line numbers of function calls. This affects A_LineNumber, ListLines, and error dialogs. [thanks Laszlo]
Fixed various ways in which normal lines were being falsely detected as function calls. [thanks Payam & Jon]
Fixed ImageSearch so that partial matches at the edges of the search region are not considered complete matches. [thanks Invalid User]
Fixed the inability of labels to contain parentheses, a bug introduced in v1.0.31. [thanks Jon]
Fixed the Clipboard variable to avoid producing an error when a set of zero files was copied onto the clipboard. [thanks Serenity & Tekl]
Fixed GuiDropFiles and Gui +/-Options so that they don't remove window transparency and other effects. [thanks toralf]
Fixed sub-expressions in function parameters yielding incorrect result; e.g. Add(2*3,3)
. [thanks Laszlo]
Fixed open-parenthesis being seen as a syntax error if used after a command that lacks a first comma; e.g. MsgBox ()
. [thanks Laszlo]
Note: Although this release has been extensively tested, quite a few low-level changes were made. It is recommended that mission-critical scripts be re-tested -- or that you wait two weeks for any bugs to get fixed -- prior to adopting this version.
Fixed the inability of a timer to reset itself. For example, if SetTimer, MyTimer
is done within the MyTimer subroutine, the timer will begin waiting for an entirely new interval to expire before running again.
Fixed syntax checker reporting parentheses inside quoted strings as unbalanced.
Fixed GuiControl to be able to change the ReadOnly attribute of an Edit control. [thanks Bahri]
Changed expressions so that references to invalid dynamic variables such as Array%VarContainingSpaces%
produces a runtime warning.
Lowered the precedence of string concatenation in expressions. Although this is unlikely to affect any scripts, if you have any doubt please consult the operator precedence table.
Improved string concatenation in expressions to work on anything (e.g. arrays and sub-expressions). In addition, a period can be used as a concatenation operator to improve readability.
Dynamic variables such as Array%i%
are up to 1000 times faster. A script may now have several million variables without a large slow-down. [thanks Laszlo]
Improved the performance of GuiControl and GuiControlGet when used on a window that has hundreds of controls.
Expressions that use a lot of ANDs and ORs are faster due to short-circuit boolean evaluation.
Improved memory conservation in scripts that use thousands of variables by adding two new variable capacities: 1 and 6. Formerly, the smallest capacity (other than zero) was 63.
Added built-in variables A_LineNumber and A_LineFile, which contain the currently executing line number and the file name to which it belongs. [thanks toralf]
Added directive #ClipboardTimeout, which changes how long the script persists in trying to open the clipboard (default 1000 ms). [thanks Tekl & Jason Payam Ahdoot]
Added the ability to pass parameters and receive return values from functions. Functions also support local variables. In addition, ListVars can show the contents of local variables to help debugging. See functions for details.
Fixed crash when a GUI window was destroyed and recreated within the same thread. [thanks corrupt]
Note: This release consists entirely of minor changes.
Changed the tray icon menu to open only after the right mouse button has been released. This allows a remapped right mouse button to open the menu correctly. [thanks eamat]
Changed WinGet Count to retrieve all windows on the system rather than the Last Found Window when all four window parameters are blank.
Improved compiled scripts to conceal the script's source code when a runtime error occurs (such as trying to launch a nonexistent file). This concealment can be disabled via Menu, Tray, MainWindow
. [thanks Rajat]
Improved StringGetPos to optionally skip over a certain number of characters on the leftmost or rightmost sides. [thanks Tekl]
Improved ClipboardAll to omit any redundant CF_METAFILEPICT data that is present, which saves space.
Improved ListBoxes so that the tab character is always expanded rather than shown as an empty square. In addition, tab-stops can now be added or changed after the control is created.
Improved the following commands to support expressions for their numeric parameters: Transform, FileReadLine, FileSelectFolder, FileSetAttrib, and FileSetTime.
Fixed WinGet List, which was partially broken by v1.0.30. [thanks twwilliams]
Changed WinGet List to retrieve all windows on the system rather than the Last Found Window when all four window parameters are blank.
Improved "lines most recently executed" so that when a waiting thread is resumed after being interrupted, the waiting command (e.g. WinWait) will be shown at the bottom of the list, which helps reveal "hung" threads. In addition, "lines most recently executed" now shows 400 lines rather than 200.
Fixed GroupDeactivate, which was partially broken by v1.0.30.
Fixed the lack of an error message when Menu Delete/DeleteAll failed on the submenu of a menu bar. [thanks Landvermesser]
Fixed mouse hotkeys that use Win+Ctrl or Win+Shift as modifiers so that the Start Menu does not appear. [thanks Mythos]
Fixed WinSet Style|ExStyle to set ErrorLevel to 1 if the target window does not exist.
Changed "GroupClose All" to close hidden windows if DetectHiddenWindows has been turned on.
Improved ClipboardAll so that variables to which it has been assigned can be compared to each other as in this example [thanks Jerry]:
if ClipSaved1 <> %ClipSaved2% ; This must be an old-style IF statement, not an expression.
Improved GUI ListBoxes with an option to set custom tab stops. [thanks jonny]
Improved Progress and SplashImage with a "Hide" option to have the window start off hidden. Use "Progress Show" or "SplashImage Show" to show it later.
Improved hotstrings with option letter "Z", which resets the hotstring recognizer after each triggering of the hotstring. The script will begin waiting for an entirely new hotstring, eliminating from consideration anything you previously typed. [thanks dennisbgoode]
Added WinSet Disable/Enable, which disables or enables a window.
Added ahk_group as a way to find window(s) matching any of the specifications in a window group. Example: IfWinExist ahk_group %MyGroup%
. In addition, an entire group of windows can be minimized, maximized, restored, hidden, shown, or closed (e.g. WinMinimize ahk_group MyGroup
). [thanks Rajat]
Added WinSet Region, which changes the display area of a window to be the specified ellipse, rectangle, or polygon. This allows parts of a window to be rendered invisible. [thanks skrommel]
Fixed things like Sleep %Seconds%000
, which stopped working in v1.0.25+. [thanks Mayhem]
Fixed the Input command to correctly capture uppercase and control characters when not in "visible" mode.
Fixed key-up hotkeys to work on the neutral keys Ctrl, Shift, and Alt. [thanks jonny]
Changed compiled scripts to always have their .exe file extension at the end of their names for the purpose of A_ScriptFullPath and default window titles. This also allows #SingleInstance to work even when the script is launched from the command line without its extension. [thanks Mythos]
Improved ClipWait to optionally wait for any data rather than just text and files.
An expression can be used in a parameter that does not directly support it by preceding it with a percent sign and a space or tab. This is most commonly used to access arrays [thanks JSLover]. Examples:
FileAppend, % MyArray%i%, My File.txt MsgBox % "The variable MyVar contains " MyVar "." Control, Choose, % CurrentSelection - 1
Added built-in variable A_MSec, which is the current time's millisecond. [thanks JSLover]
Added built-in variable ClipboardAll, which contains all data on the clipboard (such as pictures and formatting). This can be used to save and restore the clipboard to memory or a file as in these examples:
ClipSaved = %ClipboardAll% Clipboard = %ClipSaved% ; Done at a later time to restore the original contents. FileAppend, %ClipboardAll%, C:\Saved clipboard.bin ; Write the entire clipboard to a file. FileRead, Clipboard, *c C:\Saved clipboard.bin ; Restore from a file via the *c option.
Improved FileAppend and file-reading loops to be able to write text to standard output (stdout) by using an asterisk as the filename. Although such text can be redirected to a file, piped to another EXE, or captured by fancy text editors, it will not appear at the command prompt it was launched from (there is a workaround described at FileAppend). For example, the following would be valid if typed at a command prompt:
"%ProgramFiles%\AutoHotkey\AutoHotkey.exe" "My Script.ahk" >"Error Log.txt"
FileAppend's text parameter may be omitted to create an empty file or update the timestamp of an existing file. [thanks JSLover]
The following fix from v1.0.26 was undone because it is not needed: "Fixed hotkeys such as a & b::
to be seen as ~a & b::
if ~a::
also exists as a hotkey, and vice versa." In such a case, the hotkey ~a::
causes an A keystroke to be sent whenever A wasn't held down to modify another key such as B.
Improved SoundPlay to play standard system sounds (hand, question, exclamation, and asterisk). [thanks Mythos]
Improved the tray icon to optionally be unaffected by Pause and Suspend. The icon can be "frozen" by specifying 1 as the last parameter of the Menu command. Example: Menu, Tray, Icon, C:\My Icon.ico, , 1
Added ahk_pid as a way to find window(s) matching a process identifier (PID). Example: WinClose ahk_pid %VarContainingPID% ; Closes only the first matching window.
Added command SoundBeep, which emits a tone from the PC speaker. [thanks Tekl]
Added support for hotkeys that fire upon release of a key. Examples:
*LWin::Send {LControl down} *LWin Up::Send {LControl up} ^!r Up::MsgBox You pressed and released Ctrl+Alt+R.
Fixed Gui -Caption (and perhaps others) to work even if the window is visible. [thanks Watcher]
Fixed GUI progress bars so that a starting position outside the range 0-100 is possible upon creation. [thanks kapege.de]
Changed A_OSVersion to recognize Windows Server 2003 (as WIN_2003).
Post/SendMessage can broadcast to ALL windows via ahk_id 0xFFFF
, as intended. [thanks Mythos]
If you're using Post/SendMessage to trigger menu items created via the Menu command, each ID is now 10,000 higher than it was before.
Improved RunWait to support OutputVarPID (like the Run command).
Added built-in variables A_IsCompiled and A_IsSuspended, which contain 1 if the script is running as a compiled EXE or is suspended, respectively. [thanks Mythos]
Added command OutputDebug, which sends a string to the debugger (if any) for display. [thanks procyon]
Changes for GUI:
Fixed windows containing Tab controls: previously, controls outside the Tab control were sometimes invisible when the window was first shown. [thanks ranomore]
Changed GuiControl +/-Options to set ErrorLevel to 1 (failure) if none of the specified styles are allowed to be applied.
Increased the maximum number of GUI windows from 10 to 99, and the maximum number of controls per window from 1000 to 11000.
Fixed the PSPad (editor) installation script to create the AutoHotkey.ini file in PSPad's syntax vs. context folder (and two other minor fixes). [thanks RobOtter & beardboy]
Added #KeyHistory, which sets the maximum number of keyboard and mouse events displayed by the KeyHistory window. You can set it to 0 to disable key history. [thanks Mythos]
Fixed A_LoopFileLongPath, which was truncating long filenames produced from short ones. [thanks deXter & jonny]
Fixed EnvDiv and Transform Mod to allow values between -1.0 and 1.0. [thanks Mythos]
Fixed hotkeys such as a & b::
to be seen as ~a & b::
if ~a::
also exists as a hotkey, and vice versa. [thanks jonny]
Fixed unwanted interaction between hotkeys. For example, when using the hotkeys CapsLock & A::
and MButton::
, clicking the middle button while holding down CapsLock will turn CapsLock on/off as expected.
Changed MouseClick WheelUp|WheelDown
to ignore SetMouseDelay. This was done to avoid a slow-down of mouse wheel hotkeys, and also because a delay is undesirable in the vast majority of cases.
Improved PSPad's (editor) syntax and clip files in the Extras folder. [provided by GoGoGadgetScott & beardboy]
Improved SendMessage and PostMessage to support ahk_id 0xFFFF
, which is can be used to send HWND_BROADCAST messages to all windows in the system. [thanks Mythos]
Added a "fast" option to PixelSearch, which is up to 100 times faster for large search areas such as the entire screen. [code by Aurelian Maga]
Added command ImageSearch, which searches the screen for an image. [code by Aurelian Maga]
Added WinGet Transparent and WinGet TransColor. Also added WinSet Redraw, which refreshes a window by repainting it. [thanks Mythos]
Added WinSet Style|ExStyle and Control Style|ExStyle to change the styles of windows and controls not owned by the script.
Changes for GUI:
Fixed Gui +/-Disabled and Gui +/-AlwaysOnTop. In addition, it is no longer necessary to do Gui Show afterward. [thanks beardboy]
Fixed the inability to set a progress bar back to the default color. [thanks toralf]
Improved "Checked", "Disabled", and "Hidden" to recognize an optional 1 or 0 suffix. Example: Gui, Add, Checkbox, Disabled%Disabled?% Checked%Checked?%
. [thanks MikeG]
Fixed hotstrings so that they don't interfere with AltGr dead keys (diacritics) such as tilde (~). [thanks zorglups & /Torben]
Added built-in variable A_LoopFileLongPath, which overcomes the limitations of A_LoopFileFullPath. [thanks Hugo]
Applying +AlwaysOnTop works even if the GUI window already exists. [thanks kmel]
Gui Show has been changed slightly to give more consistent results, especially for windows containing Tab controls.
Applying options or styles to an existing GUI window avoids showing the window if it is hidden or minimized.
Added the following options to Gui Show: Minimize, Maximize, Restore, NoActivate, NA, and Hide. [thanks kmel]
Added the following Gui window options: +/-Disabled, +/-AlwaysOnTop, and +/-LastFound. The LastFound option sets the window to be the Last Found Window, allowing commands such as WinSet to operate on it even if it is hidden.
Fixed RunAs so that it can be used more than once. [thanks MikeG]
Fixed Menu, MyMenu, Standard
to create the menu if it doesn't yet exist. [thanks Mythos]
Fixed if Var
and if (expression)
to consider non-numeric strings to be "true", as documented. [thanks Mythos]
Fixed built-in variables so that they can be referenced dynamically even if never referenced directly. Example: A_IPAddress%A_Index%
Changed ErrorLevel so that its previous value is available to commands that give it a new value. Example: StringReplace, OutputVar, ErrorLevel, EndKey:
Changed the linefeed character (`n) to be sent as Enter rather than Ctrl+Enter. This also causes SendRaw %A_EndChar%
to work correctly when the user presses Enter to complete a hotstring. [thanks Andreas Borutta]
Fixed StringReplace (broken by v1.0.25) to work properly on large strings requiring more than 20 replacements. [thanks jordi]
Fixed GUI Picture controls containing icons so that it is possible to change their options and styles via GuiControl. [thanks toralf]
Fixed the Input command to correctly capture uppercase characters from the Send command and Hotstring replacements.
Increased the maximum number of controls per GUI window from 500 to 1000.
Improved MouseGetPos with an optional mode that better supports MDI child windows. [thanks unnamed.ahk]
Launching a script should no longer switch you out of a full-screen application such as a game. In addition, there should be less disturbance/redrawing of the taskbar. [thanks Tekl]
Improved Control Choose/ChooseString to work on multi-select ListBoxes.
Added ControlGet List to retrieve the contents of a ListBox or ComboBox. [thanks Rajat & mallow]
Fixed hotstrings: Previously, when you pressed Enter to trigger a replacement, Ctrl+Enter was sent instead of Enter. [thanks Trinity & h67o]
Fixed Slider controls so that a starting position outside the range 0-100 is possible upon creation. [thanks bahri]
Changed SplitPath to better support URLs. See SplitPath for details.
Added built-in variables true and false, which contain 1 and 0. They can be used to make a script more readable. Example: CaseSensitive := true
Fixed FileSelectFile's new multi-select option so that selecting a single file in a root folder such as C: will include a backslash after the folder name.
Fixed the fact that an expression such as Var:=" string "
would obey AutoTrim while a more complex expression would not. By design, AutoTrim should never affect expressions. [thanks Ya-Cha]
Fixed expressions so that concatenating a reference such as Array%i%
always treats Array%i%
as an empty string, as documented. [thanks Ya-Cha]
Changed expressions so that performing an invalid operation -- such as dividing by zero or subtracting a string from a number -- causes only the affected portion to evaluate to a blank string rather than the entire expression.
Changed the installer to preserve the editor associated with scripts (rather than changing it to Notepad). Also, the open/run/compile context menu items for .ahk files have been corrected to work on a broader range of systems. [thanks corrupt]
Improved PixelSearch to optionally sort from right to left rather than left to right. If any of your scripts rely on PixelSearch always reporting "not found" for an inverted search rectangle, please adjust them accordingly. [thanks BoBo & SD2K]
Improved SplitPath to support URLs. [thanks BoBo]
Fixed crash when an expression compared a non-numeric string to the numeric result of an operation. [thanks unnamed.ahk]
Fixed :=
so that it's not necessary to have a space to its left. [thanks unnamed.ahk]
Fixed string concatenation such as Var = %Var% Test
, which was partially broken by v1.0.25. This affected only concatenations that required one or more spaces to be trimmed from the left side due to AutoTrim being on. [thanks namazu(catfish)]
Fixed mouse button hotkeys that use only Win or Alt as a modifier so that they do not display the Start Menu or activate the active window's menu bar, respectively. This problem occurred only in scripts that were not using the keyboard hook. [thanks Kijuto Riddle]
Fixed scripts that assign the mouse to be AltTab, ShiftAltTab, and other alt-tab actions so that they activate the keyboard hook, which is required for their proper operation. [thanks jonny]
Improved FileSelectFile with an easier multi-select option. Although the old multi-select option will continue to function as before, it has been marked obsolete in the help file due to the difficulty of parsing its results. [thanks 3tones]
Improved StringReplace with an option to store the number of replacements in ErrorLevel.
Note: Although this release has been extensively tested, quite a few low-level changes were made. It is recommended that mission-critical scripts be re-tested prior to adopting this version.
Fixed file-pattern loops on Windows 95/98/Me so that A_LoopFileTimeModified/Created/Accessed are not blank. [thanks 3tones]
Fixed the following keys on Windows 95/98/Me to allow them to part of hotkey combinations: Del, Ins, Home, End, PgUp, PgDn, and the arrow keys.
Fixed lines such as If x = 5, Exit
so that the item after the comma is not recognized as a command. By contrast, IfEqual, x, 5, Exit
will still recognize "Exit" as a command.
Changed Transform Pow to yield a blank string rather than 0.00 when zero is raised to a negative power.
Changed compiled scripts so that the version resource shows the version number rather than being entirely blank. [thanks g4]
Changed FileAppend so that the file is automatically opened in binary mode if the text to be written contains any carriage return and linefeed pairs (`r`n
). In other words, the asterisk option is put into effect automatically. However, specifying the asterisk when appropriate improves performance because the program does not need to scan for `r`n
.
Changed file-reading loops so that the output file is not opened if nothing is ever written to it. This happens if the loop performs zero iterations or if it never uses the FileAppend command. In addition, the file is automatically opened in binary mode if the loop's first use of FileAppend writes any carriage return and linefeed pairs (`r`n
). In other words, the asterisk option is put into effect automatically. These changes might break existing scripts that rely upon: 1) a zero-length file being created by the loop; or 2) the file's modification time being changed by the loop even if it didn't write any text to the file.
Removed runtime validation of numeric parameters (to help performance). Formerly, a command such as SetKeyDelay %Var%
would produce a runtime error if Var contained something non-numeric. Most commands now treat non-numeric parameters as zero.
Improved the Progress command with options for starting position and having a range other than 0 to 100. [thanks ranomore]
Improved the Send command so that mouse buttons can be held down or released as in this example: Send {LButton down}
Improved the Sort command with an option to eliminate duplicates from the list. Also, the numeric option now treats items as floating point numbers rather than integers. [thanks Rajat]
Improved WIN and ALT hotkeys that use the Send command:
Send {LAlt down}{Shift}{LAlt up}
.{AltUp}{Alt}
anywhere in your scripts to make ALT hotkeys work better, those hotkeys should still work. However, they can be made to behave more consistently by removing {AltUp}{Alt}
.Improved performance of the following: 1) StringReplace "All" uses temporary memory (when appropriate) to greatly speed up the operation. See StringReplace for details and options. 2) Variable concatenation, such as Var = %Var%String
, is at least 100 times faster. 3) Assigning to variables when AutoTrim is "On" is faster. 4) Case-insensitive string searching is much faster, which affects StringGetPos, IfInString, if var in <list>
, StringReplace, and Input.
Added built-in variable A_LoopFileShortPath to file-pattern loops, which allows the 8.3 short path and name of a file to be retrieved. [thanks Rajat]
Added command FileRead, which reads all of a file's text into a variable (performs better than a file-reading loop).
Added support for expressions in commands that have numeric parameters, such as StringLeft. In addition, IF-statements may use complex expressions by including a parenthesis as the first character, e.g. if (X < Y + 10) and (Color = "Blue")
. Finally, Var:=expression has been added to assign the result of an expression to a variable, e.g. Var := 100*X + 1/3
. See Expressions for details about operators, string concatenation, and easier access to arrays. [thanks Joost Mulders]
Changes for GUI:
Changed Gui Show to launch the GuiSize label only after showing the window and updating its title. [thanks ranomore]
Improved drag-and-drop to report (via ErrorLevel) the number of dropped files.
Fixed StatusBarGetText and StatusBarWait: If the system was under heavy load, sometimes they would give up too soon and set ErrorLevel. [thanks Anatoly Larkin]
Fixed compiled scripts so that the version resource is blank as intended. [thanks Titan]
Improved ControlClick to optionally click at a set of coordinates rather than a specific control.
Improved memory conservation: If a script requires its temporary memory area to be greater than 4 MB for an operation such as StringReplace, Huge_Var, Huge_Var, `n, `r`n
, that memory will be freed automatically when it has been unused for 10 seconds. The 10-second delay avoids the performance penalty of frequently freeing and reallocating memory. For example, a loop with thousands of iterations might need the memory for its entire duration.
Improved behavior of command line parameters on Windows NT/2k/XP so that: 1) more than 8 files can be dragged and dropped onto a .ahk script (if the drag-and-drop option was enabled during installation); and 2) .ahk files launched directly via shortcut or command line can receive parameters containing spaces if they are enclosed in double quotes. [thanks Tekl]
Improved FileCreateShortcut with options for: 1) using an icon other than the first; and 2) setting the launch state to minimized or maximized. If you have any scripts that use FileCreateShortcut with the Ctrl+Alt+, shortcut key, please ensure the comma is escaped. [thanks Holger]
Added command FileGetShortcut, which retrieves information about a shortcut (.lnk) file, such as its target file. [thanks Holger]
Added Rajat's syntax and keyword lists to the Extras\Editors\Syntax folder in the AutoHotkey folder. These files make it easier to create and maintain syntax definitions and clip libraries for various editors.
Added sub-command Menu Click, which allows a single-click on the tray icon to activate the default menu item (normally a double-click is required). [thanks CarlosTheTackle]
Added sub-commands Drive Lock and Drive Unlock. Locking a drive prevents its eject feature from working. [thanks RG]
Added the ability to sort a variable's contents in random order. [thanks GBeam]
Added support for Unicode text on the clipboard and in variables. See Transform Unicode for details. [thanks Tekl]
Added built-in variable A_YWeek, which is the current ISO 8601 year and week number. [thanks various]
Added the following built-in variables: A_Language, A_ComputerName, A_UserName, A_Desktop, A_DesktopCommon, A_StartMenu, A_StartMenuCommon, A_Programs, A_ProgramsCommon, A_Startup, A_StartupCommon, and A_MyDocuments.
Added command FormatTime, which transforms a YYYYMMDDHH24MISS timestamp into the specified date/time format.
Changes for GUI:
Fixed radio buttons so that: 1) the g-label won't be launched just because the button receives keyboard focus; 2) the g-label is launched once rather than twice when navigating via the arrow keys; 3) focus is on the correct button when a radio group receives keyboard focus; and 4) back-to-back radio groups give their first radio button a tabstop. [thanks Gre & Jacques Bensimon]
Fixed Tab controls so that keyboard focus always lands on the first control rather than the second one when the user clicks on a new tab. In addition, the Ctrl+PgDn/PgUp/Tab navigation keys will now work when focus is on a ComboBox. [thanks wkueting]
Fixed the "Limit" option for Edit controls, which was broken by v1.0.23. [thanks ranomore]
Fixed GuiControl +/-Options to allow the Check3 style to be added or removed on Checkboxes. Also, controls are always redrawn when their styles change. [thanks beardboy]
Changed ComboBoxes so that their g-labels (if any) are launched whenever the user changes the text in the edit portion of the control.
Improved Picture controls so that: 1) Icons and cursors can be loaded from .cur, .ani, .ico, .dll, and .exe files; and 2) Width and height can be specified when loading a new image via GuiControl. If any of your scripts use BackgroundTrans to make an icon transparent, add the word AltSubmit to that control's options. [thanks Rajat]
Added a method to set custom tab stops inside Edit controls. [thanks Jason Payam Ahdoot]
Added an "Invert" option for Slider, which reverses the low and high ends of the control. [thanks beardboy]
Added sub-command Gui N:Default, which changes the default GUI window number of the current thread to N.
Added the GuiSize label, which is launched whenever a GUI window is resized, minimized, maximized, or restored.
Added support for drag-and-drop via the GuiDropFiles label.
Changed compiled scripts to include a blank version info resource. To customize the version info of your compiled scripts, use a utility such as Resource Hacker (freeware) to edit the AutoHotkeySC.bin file. Note that ResHacker will corrupt compiled scripts, which is why only the AutoHotkeySC.bin file should be edited. [thanks Larl]
Improved the $ hotkey prefix to work on Windows 95/98/Me. It allows a hotkey to send itself, which makes it possible for a hotkey to conditionally perform its original/native-OS function.
Improved PixelGetColor and PixelSearch with an option to retrieve colors in RGB vs. BGR format.
Improved Menu Show to accept an optional position for the menu. [thanks compuboy_r]
Improved the performance of the Hotkey command when it turns on/off a hotkey that is already in the right state. [thanks deguix]
Added sub-commands Style and ExStyle to WinGet, which retrieve a window's style and extended style. [thanks ranomore]
Added built-in variables A_ProgramFiles and A_WinDir for operating systems that might lack the corresponding environment variables.
Added sub-command WinSet Bottom, which sends a window to the bottom of the stack; that is, beneath all other windows. [thanks AntonyB]
Added WinSet, Transparent, Off
, which completely turns off transparency on a window that was previously transparent. This may help performance. [thanks dijiyd]
Added sub-command WinSet TransColor, which can make a window's background transparent on Windows 2000/XP+. This allows the creation of on-screen displays and other visual effects.
Changes for GUI:
Fixed Gui Show: Sometimes the window wouldn't be shown until after the command that followed Gui Show. [thanks Tekl]
Fixed Picture controls that have a border so that the size of the control doesn't increase slightly each time GuiControl is used to load a new picture. [thanks ILL.1]
Fixed Tab control so that when it is hidden or shown, the controls on its current page are also hidden/shown. In addition, some minor keyboard navigation issues were fixed. [thanks Nemroth]
Changed Tab controls so that enabling or disabling them will also enable/disable their sub-controls.
Changed Tab controls to use Classic Theme appearance on Windows XP or later, which makes their background color match that of their sub-controls. [thanks Gre]
Removed the 32 KB limit on the amount of text that can be contained in an Edit control. Windows 9x will be limited to 64 KB and other operating systems to as much as 4 GB. [thanks Bahri]
Improved screen drawing performance when switching pages in a Tab control.
Improved overall GUI performance, especially for windows with a large number of controls.
Added wp+n and hp+n control positioning options, which use the width and height of the previous control.
Added BackgroundTrans option for Text, Picture, and GroupBox controls. It allows other controls behind them to show through.
Added built-in variables A_Gui and A_GuiControl, which contain the GUI window number and Control ID responsible for launching the current thread. [thanks Rajat]
Added sub-command GuiControl Font, which changes a control's font.
Added control type Slider, which is a sliding bar that the user can move along a vertical or horizontal track.
Added control type Progress, which is a dual-color bar typically used to indicate how much progress has been made toward the completion of an operation.
Added control type Hotkey, which is a box that looks like a single-line edit control but instead accepts a keyboard combination pressed by the user.
Fixed ToolTip failing to appear on Windows XP. [thanks Phi and /Torben]
Fixed the left mouse button when it is used as a hotkey: if it displayed a pop-up menu, the foreground window was seeing the button as stuck-down after the menu was dismissed. [thanks umek]
Improved SetKeyDelay with an optional delay between the down-event and up-event of each keystroke.
Improved GetKeyState, KeyWait, Input, and hotkeys to support an explicit virtual key such as vkFF. This is useful for keys that have no name and that produce no visible character when pressed. Unfortunately, all such keys tend to share the same virtual key code (FF); so if you have more than one of them, this method will not be able to tell them apart (except hotkeys, which should use the scNNN method described at the bottom of the key list page).
Improved FileMoveDir to support an optional rename mode, which provides "all or none" behavior. [thanks Tekl].
Added sub-command WinGet MinMax, which retrieves -1 if the window is minimized, 1 if it is maximized, or 0 if it is neither.
Added WinGet ProcessName, which retrieves a window's process name. [thanks Wademan]
Added command Drive, which ejects/retracts the tray in a CD or DVD drive, or sets a drive's volume label.
Added sub-command DriveGet StatusCD, which retrieves the media status of a CD or DVD drive.
Added built-in variables A_ScreenWidth and A_ScreenHeight, which contain the width and height of the primary monitor, in pixels.
Added built-in variable A_AhkVersion, which contains the AutoHotkey version number.
Added command SysGet, which retrieves screen resolution, multi-monitor info, the dimensions of system objects, and other system properties. [thanks Gregory F. Hogg of Hogg’s Software]
Changes for GUI:
Fixed Edit controls that have an explicit height (H) that is tall enough to be multi-line: word-wrapping is ON by default, as intended. [thanks Alfredo]
Fixed possible crash (never actually observed) when a window destroys itself, such as via a Quit button.
Fixed Gui Show so that the window's previous dimensions are retained if unspecified. [thanks lingoist]
Fixed Gui Show so that when called from the tray menu (and perhaps other times), the window will have keyboard focus. [thanks Tekl]
Slightly changed the height of a GroupBox when height is omitted or a row-count is specified. It should now conform better to the current font size. In addition, if no width is specified for a GroupBox, it will be slightly narrower.
Changed GuiControl Choose to automatically revert to the ChooseString method if the item-parameter is not numeric.
Improved ListBox to support an optional horizontal scroll bar via the word HScroll in its options.
Improved Picture controls to support many additional image formats such as PNG, TIF, and ICO if the OS supports them. If your OS is older than XP (except Windows 95), you can add support by downloading the free GDI+ extension from Microsoft.
Added sub-command GuiControl Text, which is the same as the set-contents method except for radio buttons and checkboxes, in which case Param3 is treated as the new text/caption even if it is -1, 0, or 1. [thanks Rajat]
Added new control type: Tab (SysTabControl32), which is a relatively large control containing multiple pages, each of which contains other controls.
Fixed hotstrings: occasionally and randomly they would fail to activate. [thanks Jack Horsfield]
Fixed Progress command so that a custom bar color is obeyed on Windows XP+ rather than being overridden by the user's current theme [thanks Gre]. To instead use the current theme's appearance, leave the bar color unspecified.
Fixed ControlSend of modifier keys (e.g. capital letters and ^{end}
) when a script targets one of its own GUI windows or when the keyboard hook is installed. [thanks beardboy & Gregory Punshon]
Fixed Send command when sending mouse clicks so that the correct CTRL/ALT/SHIFT/WIN key state is in effect. Also, ControlSend can no longer send mouse clicks since otherwise they would take effect in the window under the mouse cursor.
Fixed ToolTip so that the tip window can be displayed on non-primary monitors in a multi-monitor system. [thanks Jack Horsfield]
Changed PixelGetColor and Window Spy to retrieve colors in hexadecimal rather than decimal format, which makes it easier to visualize a color based on its blue, green, and red components. This change should not affect existing scripts. [thanks Bobo]
Improved Window Spy with a more useful layout and to show the text of the control under the mouse.
Improved the Input command to optionally recognize and transcribe modified keystrokes such as Ctrl+A through Ctrl+Z if they correspond to real ASCII characters. The following example recognizes Ctrl+C:
Transform, CtrlC, Chr, 3 ; Store the character for Ctrl-C in the CtrlC var. Input, OutputVar, L1 M IfEqual, OutputVar, %CtrlC%, MsgBox, You pressed Control-C.
Improved ControlSend so that if a script explicitly specifies modifier up and down events, such as {Alt down}f{Alt up}
rather than !f
, those events will be sent in a way less likely to interfere with the active window. Note: In prior versions, ControlSend did not correctly handle explicit modifier up and down events such as {Ctrl down}
and {Ctrl up}
.
Added Style and ExStyle (extended style) sub-commands to ControlGet.
Changes for GUI:
Fixed checkboxes and radio buttons so that they will obey the specified text color even if an overriding Windows XP theme is in effect. However, as a side-effect the controls will revert to the classic-theme appearance whenever a custom text color is specified.
Fixed GuiControl so that it is possible to make the contents of a control blank. [thanks Rajat]
Fixed cosmetic appearance of the default button. Previously, it sometimes took on the appearance of a normal button.
Changed the appearance of controls and windows throughout the application to use Windows XP visual styles if the current display theme allows them. [thanks Titan]
Changed DropDownList and ComboBox on Windows XP so that if the height is unspecified, the control's drop-list height will take advantage of the amount of desktop height available.
The recognition of the option words and letters for Gui Add is now stricter (but 99% of GUI scripts should be unaffected): options must be separated from each other by at least one space or tab, and any options that accept an argument (such as x30 for the x-coordinate) must be followed immediately by that argument, that is, with no whitespace in between.
Reduced the frame thickness around some control types (e.g. Edit) to a more traditional size.
All control types may now have an associated variable. This makes it easier to uniquely identify a control when using GuiControl and GuiControlGet.
Improved DropDownList, ComboBox, and ListBox to optionally store the position rather than the text of the selected item upon Gui Submit or GuiControlGet.
Added sub-command Gui Flash, which blinks the window's title bar and/or taskbar button. [thanks beardboy]
Added Gui +/-Theme, which allows controls to be created with Classic Theme appearance on Windows XP+.
Added the ability to change an existing control's options and styles via GuiControl.
Added multi-select option for ListBox via the word Multi in its options.
Added many additional control options and named styles. In addition, any unnamed numerical style may be applied, such as the ones in the styles table.
Fixed commands "if var between/in/contains" so that the second item in the MatchList is not misinterpreted as a command if it happens to match one. [thanks Rajat]
Fixed the hotkey $Tab::
(TAB as an unmodified hook hotkey) so that it doesn't: 1) fire when Alt+Tab is pressed; 2) prevent Alt+Tab from working. [thanks antonyb]
Fixed MsgBox so that the Timeout parameter can be contained in a variable. [thanks jordi]
Fixed SetTimer so that 10ms timers will be able to run every 10ms (rather than every 20ms) when SetBatchLines is at its default setting of 10ms.
Fixed A_Index so that it doesn't get periodically reset to 1 inside file-pattern and registry loops that recurse into subfolders/subkeys.
For anyone using Post/SendMessage to automate AutoHotkey itself: The IDs of the standard menu items in the tray and main window have been changed: they now begin at 65300 vs. 32789. Please adjust your scripts accordingly.
Version info (which can be seen in Explorer's file-properties dialog) is now omitted from compiled scripts. This change reflects the fact that scripts are owned by their authors and thus should have as little AutoHotkey association and branding as possible. An author can add custom version info by using a free utility such as ResHacker. [thanks Bobo & Titan]
Increased maximum length of menu names and menu items names from 100 to 260. In addition, menus should use slightly less memory now.
Improved the speed of the Menu Add command: Scripts whose menus collectively contain thousands of items should now be able to create new menu items at least 100 times faster.
Improved the Send command to support mouse button and mouse wheel [thanks Wolfgang Reszel (Tekl)]. If any of your scripts use Send {LButton}
or similar (probably without effect), please adjust them accordingly.
Added configuration files for EmEditor and MED (contained in the Extras folder). [thanks Wolfgang Reszel (Tekl)]
Added a method to retrieve a list of all controls in a window. Example: WinGet, OutputVar, ControlList, A
Changes for GUI:
Fixed cosmetic appearance of buttons when they are clicked rapidly. [thanks Rajat]
Fixed Picture controls that are used as background for other controls: They will no longer steal mouse clicks unless they have an associated g-label. [thanks Rajat]
Fixed the Menu command: if it makes changes to a menu bar, those changes become visible immediately if the GUI window is visible. Also, changing a menu's color back to the default color should now work properly.
Increased maximum number of windows from 5 to 10.
(Might break existing scripts): If a radio group has multiple buttons but only one variable, that variable will assigned the number of the selected radio button (0 if none, 1 for the first, 2 for the second, etc.) [thanks Rajat] If you have any radio groups whose buttons do not all have variables, please adjust them accordingly.
(Might break existing scripts): By default, threads launched as a result of GUI action will now operate upon the window number where the action occurred. Previously, the GUI command would assume the number 1 if the window number was not specified. If you have any scripts that use multiple windows, please change them accordingly.
(Might break existing scripts): Scripts that contain the GUI command anywhere are automatically single-instance unless the #SingleInstance directive has been used to override that. In addition, GUI scripts are now instantly persistent rather than becoming so only after a GUI window is created.
Added "underline" option to the Gui Font command.
Added +/-Resize as an option to make a window resizable. Example: Gui, +owner +resize
Added XS, YS, and Section as options for Gui Add. These options allow a window to be divided into sections, each of which can have its own rows and columns of controls. Note: when using a layout editor such as SmartGUI Creator, these options are typically of no use. [thanks Jack Horsfield]
Added built-in variable A_GuiControlEvent, which allows double-clicks to be detected for ListBox, Radio, Picture, and Text controls.
Added commands GuiControl and GuiControlGet, which perform various operations upon individual controls.
Fixed hotstrings and the Input command to recognize characters produced with AltGr (Ctrl+Alt), such as the @ symbol. [thanks Tekl, jordi, and /Torben]
Fixed hotstrings so that caseless characters such as digits do not disqualify an abbreviation from being considered uppercase. For example, if ::pt1::pteranodon
is a hotstring and you type PT1 (all caps) the replacement will now be in all caps as it should. In addition, other minor changes to the "case conform" mode have been made.
Fixed the Menu DeleteAll sub-command so that it doesn't permanently disable any "sub-sub-menus" indirectly owned by a menu. [thanks compuboy_r]
Fixed sub-command Process Priority so that the priority level can be contained in a variable. [thanks Rajat]
Fixed commands that turn on the keyboard hook (such as Input) so that they will not re-enable suspended hotkeys. [thanks jordi]
Fixed auto-centering of InputBox, SplashImage, Progress, and SplashTextOn: If the task bar was anchored on the left or top side of the screen, the centering was off by the thickness of the taskbar.
Fixed WinGetText and ControlGetText so that the retrieved text is limited to the maximum size of a variable, which defaults to 64 MB. [thanks hermitress]
Changed BlockInput so that input blocking is momentarily disabled whenever the Send command needs to simulate an ALT keystroke. Since there is a slight chance this will break existing scripts that attempt to send ALT while BlockInput is ON, please check and adjust accordingly.
Improved BlockInput to optionally come on automatically during any of the following commands: Send, SendRaw, MouseMove, MouseClick, and MouseClickDrag. [thanks beardboy]
Slightly improved the monitoring and buffering of hotkeys (especially joystick) during times when the script is displaying a dialog or is uninterruptible.
Added directive #MaxMem, which allows the maximum capacity of each variable to be changed from its default of 64 MB.
Added an option to Run/RunWait that avoids the display of the warning dialog and the termination of the current thread. [thanks compuboy_r and others who have asked]
Added an option to change the background color of a menu via Menu, MenuName, Color, ColorValue
(has no effect on Windows 95/NT).
Added command KeyWait, which waits for a key or mouse/joystick button to be released or pressed down.
Added command "if var [not] contains MatchList", which is the same as using IfInString/IfNotInString except that multiple search strings are supported (any one of which will cause a match). [thanks whynot]
Added command GUI, which creates and manages windows and controls. Such windows can be used as data entry forms or as custom user interfaces.
Fixed sticking modifier keys (Ctrl, Alt, Shift, and Win) -- at least in some cases. This should help prevent hook hotkeys from unexpectedly firing when the user isn't even holding down any modifier keys. The fix operates by correcting the hook's modifier state whenever it disagrees with what the OS says it should be.
Fixed mouse button hotkeys: If a script defines LButton as a hotkey, the script's own menus should now operate correctly. Similarly, if a script defines RButton as a hotkey and its subroutine uses MouseClick, right
, the tray icon should now respond correctly to a right-click as long as SetMouseDelay is at the default setting or lower.
Fixed support for diacritic and other characters, which was broken in v1.0.16/17. [thanks jordi]
Fixed some problems with neutral modifier keys (Shift, Control, Alt) that are used as both a prefix and suffix as in this example:
Shift & CapsLock::MsgBox You pressed CapsLock while holding down a Shift key. Shift::MsgBox You released a Shift key without having used it to modify another key.
Fixed CoordMode Caret
so that it uses its own setting rather than that of CoordMode ToolTip
.
Fixed A_CaretX/Y so that they are always both blank if there is no active window or the caret position could not be determined.
Changed the Input command so that the user can toggle CapsLock, NumLock and ScrollLock during an invisible Input.
Improved the hook's handling of neutral modifier keys (Alt, Ctrl, and Shift) to make them more specific to which key (left or right) was actually pressed. This is most likely to affect Windows NT4.
Added command "if var [not] between value1 and value2", which checks whether a variable's contents are numerically or alphabetically between two values.
Added command "if var [not] in value1,value2,...", which checks whether a variable's contents match one of the items in a list.
Added built-in variable A_ThisMenuItemPos, which is a number indicating the current position of A_ThisMenuItem within A_ThisMenu.
Added command Process, which performs one of the following operations on a process: checks if it exists; changes its priority; closes it; waits for it to close. [thanks AutoIt Team] In conjunction with this, the Run command has been enhanced to optionally retrieve the Process ID of a newly launched program. Also, a window's Process ID can be retrieved with WinGet.
Fixed Ctrl+Alt+Del security screen and Win+L (lock the computer) to prevent sticking keys. Both were partly broken by v1.0.16. [thanks frk]
Fixed hotstrings for keyboard layouts that use dead keys -- such as acute (´
), circumflex (^
), and grave (`
) -- so that the keyboard will continue to function properly. [thanks /Torben & Jordi]
Fixed auto-replace hotstrings so that end-chars reserved by the Send command, such as !{}
, are sent as part of the replacement.
Fixed registry loops so that an entire root key can be recursively searched. [thanks sleepyy35]
Fixed command Suspend, which sometimes permanently disabled all hotstrings. [thanks Loneaussie]
Fixed commands Suspend and Hotkey so that they avoid resetting the state of hotkeys that the user is holding down. [thanks WhiteCloud]
Fixed the Input command so that a match-list contained in a variable will not be ignored if its first character is a comma. [thanks Rajat]
Changed the Input command's MatchList so that two consecutive commas results in a single literal comma. For example, the following would produce a single literal comma at the end of string1: string1,,,string2
.
Added sub-command Transform Deref, which expands variable references and escape sequences contained inside other variables. [thanks various]
Added built-in variable A_EndChar, which is the ending character pressed by the user to trigger the most recent non-auto-replace hotstring. If no ending character was required (due to the * option), this variable will be blank.
Added built-in variables A_CaretX and A_CaretY, which are the current X and Y coordinates of the caret (text insertion point).
Possible script-breaking changes: Although 99% of scripts should be unaffected, this top section lists all the changes that might be a problem. I tried to get as many of them into this release as possible to minimize the need for this in the future.
Changed default BatchLines from 10 to 10ms, which makes lengthy operations -- such as loops that have many iterations -- run much faster. The large majority of scripts should continue to function properly. However, if you want 100% compatibility with the prior version of AutoHotkey, add SetBatchLines 10
to the top of any script that does not already use the SetBatchLines command.
Changed scripts that use hotkeys, hotstrings, or #Persistent so that #SingleInstance is automatically implied. Use #SingleInstance Off
to override this.
Changed the Input command so that Enter is seen as the more-appropriate linefeed (`n) rather than carriage return (`r). This affects the contents of OutputVar and MatchList. Please change your scripts accordingly.
Changed Run/RunWait so that they will launch non-EXE files (such as documents), using the default verb rather than "open". Since the default verb is usually "open", this shouldn't affect most existing scripts.
(normal changes below this point)
Fixed Run/RunWait of .lnk files (shortcuts). [thanks ealerner]
Fixed StringUpper/StringLower so that they work on accented letters and other letters whose ASCII value is above 127.
Fixed Progress so that the W (window width) option works again.
Fixed Shift+Win hotkeys that used the Send command: In some cases, extra Shift events were being generated, which interfered with the ability to use a hotkey two or more times in a row. [thanks Jabberwock]
Fixed ambiguity with `::
when it's used as part of a hotkey rather than literally in a command. [thanks Rajat]
Fixed InputVars that dynamically resolve to the names of environment variables. Sometimes the value was not being fetched from the environment [thanks Samlii]. Example:
EnvVar = SystemRoot StringTrimLeft, OutputVar, %EnvVar%, 0
Fixed Alt so that if it is itself a hotkey that fires on key-down, keys sent by the Send command will not be modified by Alt. [thanks Wade]
Fixed A_LoopFileDir to be blank for files contained in the root folder of a relative-path search.
Fixed the Input command so that having more than 1024 items in the match-list does not cause a memory problem. In addition, activating the Ctrl+Alt+Del security screen no longer causes it to think that Ctrl and Alt are stuck down. [thanks frk and beardboy]
Changed the Input command so that Ctrl+Backspace and other modified backspaces are ignored. Only plain backspace is used as an "undo" keystroke.
Changed custom menu items so that they cannot interrupt the OnExit subroutine (as documented). In addition, custom menu items now behave more like hotkeys in terms of buffering and their ability to interrupt other threads.
Increased max size of each variable from 16 to 64 MB (this does not increase the memory used by scripts). This can be made a configurable option if anyone needs it.
It is now possible to use a literal pair of colons by escaping it, e.g. `::
.
Scan code prefix keys are now possible, e.g. SC118 & Enter::MsgBox
. [thanks Rajat]
Improved SplashImage:
Improved ControlClick so that a specific X and Y coordinate within the control can be clicked. [thanks Beastmaster]
Added support for the AutoIt v2 command HideAutoItWin, which does the same thing as Menu, Tray, Icon|NoIcon
.
Added support for thread priority, which determines whether a thread can interrupt (or be interrupted by) other threads. The following commands support setting the priority: Hotkey, Menu, SetTimer, #Hotstring, and Thread (sets the current thread's priority). In addition, hotstrings can be individually assigned a priority when they are defined.
Added commands SendRaw and ControlSendRaw, which send keystrokes exactly as they appear rather than translating {Enter} to Enter, ^c to Ctrl+C, etc.
Added built-in variables for month name (A_MMMM and A_MMM) and day name (A_DDDD and A_DDD). In addition, A_Year may now be optionally referred to as A_YYYY, A_Mon as A_MM, and A_MDay as A_DD.
Added built-in hotstrings and auto-replace. This is a fairly major feature and due to its variety of uses, it will probably be refined in the coming weeks based on your ideas and feedback.
Fixed Menu, MyMenu, Show
so that the menu can always be canceled by clicking outside of it. [thanks Rajat]
Fixed the Progress command so that a window will be created even if no options are specified.
Fixed Ctrl+Alt+Del on Windows XP systems that have been configured to show the security screen instead of the task manager: Ctrl and Alt should never be stuck down upon returning. [thanks frk]
Fixed auto-centering of InputBox window, which was off slightly due to not taking the task bar into account.
Relaxed the restrictions on the following commands so that they can run in their simplified parameter mode even when used in a subroutine called from their parent loop's body: RegRead/Write/Delete, FileAppend, FileGet/SetAttrib, FileGet/SetTime, FileGetSize/Version.
A compiled script can now be decompiled (if you know the password) via Exe2Ahk. [thanks Jon Bennett]
Renamed two options in the Progress command: In your scripts, rename ZC (bar color) to CB, and ZB (bar height) to ZH.
Improved the Progress command:
Improved SplashTextOn and Progress so that their windows are not hidden when the main window is minimized.
Improved ToolTip so that more than one tooltip window can be created. [thanks Rajat]
Improved FileGetTime and FileGetSize so that they work on files that are in use, and so that they don't change the file's last access time.
Improved StringMid to optionally extract characters to the left of the specified position. [thanks Rajat]
Added text-to-HTML conversion via Transform HTML. It translates characters whose ASCII values are above 127 to their HTML names (e.g. £
becomes £
). In addition, the four characters "&<>
are translated to "&<>
. Finally, each linefeed (`n
) is translated to <br>`n
(i.e. <br>
followed by a linefeed).
Added command ControlGetPos. [thanks Jerry]
Added command SplitPath, which separates a file name into its name, directory, extension, and drive.
Added command SplashImage, which displays a GIF, JPG, or BMP image with optional accompanying text.
Improved Window Spy so that it always reports the correct control names in multi-pane (tabbed) dialogs. In addition, the control whose center is closest to the cursor will now take precedence when there are overlapping controls.
Improved MouseGetPos to optionally retrieve the name of the control under the cursor. [thanks jamestr]
Improved FileSelectFile to optionally present a Save button instead of an Open button.
Improved ToolTip so that it never blocks the mouse cursor when its coordinates are unspecified.
Improved the Input command to support shifted end-keys (typically punctuation marks such as :!?@
). If you have any scripts that specify non-alphabetic end-keys that have shifted counterparts (e.g. semicolon and colon), they may need to be adjusted slightly.
Improved "if var is [not] type" to support the following types: lower, upper, and xdigit.
Added command line parameter /ErrorStdOut, which sends any syntax error that prevents a script from launching to stdout rather than displaying a dialog. This allows fancy editors such as Scite and EditPlus to jump to the offending line. The new command #ErrorStdOut does the same thing, but since it would have to be added to every script, it's usually better to set up your editor to use the command line parameter. [thanks Jack Horsfield & JdeB]
Added support for sending keys that have non-standard scan codes. Use Send {vkXXscYYY}. [thanks various]
Added command Progress, which displays one or more progress bar windows. [thanks AutoIt3 team]
Fixed hook hotkeys that used a keyboard prefix but a mouse button suffix when the prefix was also a suffix [broken in v1.0.12 -- thanks jamestr]. Example:
$a::Send, a a & LButton::Send, b
Fixed interference among multiple scripts using the hooks simultaneously.
Fixed Send {Asc nnnnn} so that it allows codes beyond 255 (Unicode) to be sent. [thanks Aj]
Changed: A script will only assume Ctrl/Alt/Shift/Win are permanently down if it put them that way. [thanks jamestr & Jon]
Improved SplashTextOn so that its text is updated more quickly. [thanks Sds]
Improved the Send command's support for non-English letters, symbols, and keyboards. If this applies to you and you notice any problems with this version, please let me know. The following are some of the characters supported: €‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ
(Use Send {Asc nnnnn} to create Unicode characters whose ANSI values are greater than 255)
Improved the Send command by further limiting its ability to interfere with hotkeys that are being held down by the user to auto-repeat them (only helps hook hotkeys). [thanks jamestr & Jon]
Improved the Menu command to optionally use ErrorLevel instead of displaying runtime errors.
Added the ability to change the script's icon while it's running. This affects both the tray and InputBox icons. Use Menu, Tray, Icon, FileName [, IconNumber]
.
Added the ability to change the tray icon's tooltip via Menu, Tray, Tip [, NewText]
[thanks beardboy]
Added built-in variables A_ThisMenuItem and A_ThisMenu, which correspond to the most recently launched custom menu item.
Added built-in variables A_Now and A_NowUTC, which contain the current time in YYYYMMDDHH24MISS format.
Added the following built-in variables, which contain the current states of their associated commands: A_TitleMatchMode, A_TitleMatchModeSpeed, A_DetectHiddenWindows, A_DetectHiddenText, A_AutoTrim, A_StringCaseSense, A_FormatInteger, A_FormatFloat, A_KeyDelay, A_WinDelay, A_ControlDelay, A_MouseDelay, A_DefaultMouseSpeed, A_IconHidden, A_IconTip, A_IconFile, and A_IconNumber.
Added command OnExit, which specifies a subroutine to run when the script exits. In addition, the built-in variable A_ExitReason has been added, which contains the reason the script is being asked to terminate (e.g. Logoff). [thanks beardboy]
Added command Sort, which arranges a variable's contents in alphabetical or numerical order.
Added the following menu features:
Fixed the script compiler (ahk2exe) so that it will see FileInstall commands even if they are on the same line as an IF command as in this example: IfMsgBox, Yes, FileInstall, ...
[thanks Rajat]
Fixed the ExcludeText parameter of all windowing commands. Previously, it didn't do much at all.
Fixed some problems involving rare usages of a key/button as both a hotkey prefix and suffix. In the following example, A did not repeat when held down. In addition, the $^a::
hotkey would fire on key-up when it should have fired on key-down:
~a & b::MsgBox "B" was pressed while "A" was held down. $^a::MsgBox ^a
Fixed non-suppressed prefix keys that are also used as modified suffixes (rare): their up-events were being incorrectly suppressed as in this example: [thanks Rajat]
~!LButton::ToolTip, clicked ~LButton & RButton::MsgBox The right button was clicked while the left button was held down.
Fixed composite hotkeys that use a neutral (non-left/right specific) prefix such as Control & LShift::
. In addition, neutral suffixes are now supported, e.g. AppsKey & Control::
.
Fixed the wrong hotkey firing when a key was physically pressed or held down during a Send operation (very rare even then). This fix only works for hook hotkeys.
Changed for Windows NT4 only: Ctrl/Alt/Win/Shift are handled more specifically as left or right rather than neutral, which may improve support for some types of hook hotkeys.
Improved the Hotkey command to optionally toggle a hotkey to its opposite state (enabled or disabled). Some optimizations were also done to this command. [thanks beardboy]
Improved MouseGetPos to optionally retrieve the unique ID number of the window under the mouse cursor. This ID number can be used in the WinTitle parameter of all windowing commands by preceding it with the string ahk_id
.
Added command WinGet, which retrieves the unique ID number for a window, or finds all the windows that match the specified criteria.
Fixed FileSelectFile so that it doesn't change the script's working directory (%A_WorkingDir%). [thanks Jon]
Fixed SoundPlay, which was sometimes causing a script to hang during Exit or Reload [thanks jamestr & Larry Keys]
Fixed the fact that numbers with a leading zero would sometimes be interpreted as octal (base-8).
Fixed a rare sticking of Win and Alt when more than one script was using the keyboard hook simultaneously.
Fixed a bug in parsing loops that occurred only when the delimiter list was empty but the omit-list was not. [thanks Beastmaster]
Fixed for Windows NT only: GetKeyState and the fact that the Send command wasn't releasing the hotkey's own modifiers when it should. [thanks beardboy]
Changed Loops so that a variable containing a floating point number can be used. Example: Loop, %MyFloat%
Updated the help file to indicate that the various control commands are affected by SetTitleMatchMode when searching by the control's name rather than its class + sequence number.
Improved MouseMove, MouseClick, and MouseClickDrag to optionally move the cursor relative to its current position. [thanks Rajat]
Added mode 3 (exact match) to SetTitleMatchMode. [thanks Jack Horsfield]
Added command SetWorkingDir, which changes the script's working directory (%A_WorkingDir%).
Added command WinGetClass, which retrieves a window's class name. [thanks compuboy_r]
Added command Transform, which performs miscellaneous math functions and tasks such as ASCII conversion and bitwise operations. [thanks Rajat]
Added command Hotkey, which creates, modifies, enables, or disables a hotkey while the script is running. [thanks various]
Fixed all the windowing commands so that they can act upon windows that lack a title. [thanks Rajat]
Fixed: If a script had exactly one timer, and it turned itself off during a Sleep or other delay, the script would sleep forever. [thanks beardboy]
Fixed ambiguity between variables and commands. The first word of a line such as the following will now be interpreted as a variable rather than a command: Input = String
Fixed #Persistent so that it works on all types of scripts.
Fixed ControlGet, OutputVar, Line, 1
and Control, Choose, 1
.
Fixed some problems with mouse hotkeys in scripts that don't use the keyboard hook.
Fixed delays of length 0 to be as long as they were in v1.0.08. This affects commands such as SetWinDelay and SetControlDelay.
Fixed ControlSetText so that the Control parameter can be left blank.
Customized AutoScriptWriter for AutoHotkey. It now uses MouseClick vs. LeftClick, uses accent vs. backslash as its escape character, and saves files with the .ahk extension. [thanks Larry Keys]
Improved the tilde (~) hotkey modifier so that it works with prefix keys. For example, if ~RButton & C::Run, Calc
is a hotkey, the right mouse button will exhibit its normal function rather than doing nothing. [thanks Riccardo]
Improved IniDelete so that the Key can be omitted to delete an entire section. [thanks beardboy & Atomhrt]
Improved #SingleInstance to optionally ignore attempts to launch a script that is already running. [thanks Rajat]
Improved ListLines to show 200 vs. 50 lines and to show the elapsed time between lines. [thanks beardboy]
Improved MouseClick, MouseClickDrag, and ControlClick to support the 4th and 5th mouse buttons and the turning of the mouse wheel. [thanks skrommel]
Added built-in variable A_Cursor, which contains the name of the mouse cursor currently being displayed. [thanks AutoIt3 team & mgetlik]
Added built-in variable A_IsAdmin, which contains 1 if the current user has admin privileges or 0 otherwise. [thanks AutoIt3 team & jpk]
Added built-in variables A_IPAddress1, 2, 3, and 4, which contain the IP addresses of the computer's first four network adapters. [thanks AutoIt3 team & Rajat]
Added command CoordMode, which allows screen (absolute) vs. relative coordinates to be used for any of following groups of commands: Mouse (Move, Click, Drag, GetPos), Pixel (GetColor, Search), and ToolTip. Also, Window Spy now shows both relative and screen coordinates. [thanks to various]
Added command DriveGet, which retrieves various information about the computer's drives. [thanks AutoIt3 team & Rajat]
Added command TrayTip, which displays a balloon message window near the tray icon.
Added command Input, which waits for the user to type a string. [thanks to various]
Added support for joystick hotkeys. In addition, GetKeyState can retrieve the state of joystick buttons, axis positions, and other info. See the key list for details. [thanks compuboy_r & Rajat]
Fixed FileSelectFile on Windows 95/98/Me/NT (it didn't work at all). [thanks Mike Griffin]
Fixed Run & RunWait on Windows 95/98/Me: They would sometimes incorrectly report a failure.
Fixed compiled scripts having their custom icons overridden in the tray on Windows 95/98/NT/2000. [thanks beardboy]
Fixed the tray menu checkmarks for Pause and Suspend, which didn't work in compiled scripts.
Fixed PostMessage/SendMessage so that they send to the specified control rather than always to the parent window.
Fixed hotkey subroutines that cause a runtime error so that they aren't disabled after the error.
Fixed a few specific types of scripts: they would sometimes halt without cause. [thanks Beastmaster]
Fixed InputBox so that ErrorLevel is correctly set even if multiple input boxes exist simultaneously and are dismissed out of order (rare).
Changed InputBox so that the buttons are the same size, which makes the window resize more evenly. [thanks beardboy & Rajat]
Removed the "Hook is already installed" and "Hook is not supported (Win9x)" warning messages because the hooks can be installed by more than one script without a problem.
Improved #SingleInstance with an optional FORCE parameter that skips the warning dialog. [thanks beardboy]
Improved Send so that:
{Ctrl}
avoids temporarily adjusting the state of other modifier keys;{RCtrl}
better conforms to expected behavior;{LShift down}
and {Alt down}
cause the key to stay down even after the send is over.Improved the mouse click commands to accept just the first letter of the button name (L/R/M). [thanks Rajat]
Improved the tray icon by having it recreated whenever Explorer crashes.
Improved InputBox with an optional timeout as well as a default string for the dialog's edit field. [thanks Beastmaster]
Improved FileSelectFile to optionally provide a default filename in the dialog's edit field. [thanks Beastmaster]
Improved FileSelectFolder to optionally provide an edit field for the user to type the name of a folder.
Improved parsing loops with built-in handling for CSV (comma separated value) format. [thanks Robert Yaklin]
Improved the security of compiled scripts, which closes some loopholes that allowed the source code to be viewed. [thanks Rajat]
Improved StringGetPos so that it is able to find a match other than the first. [thanks Robert Yaklin]
Added an index to the help file. [thanks Rajat]
Added syntax and cliptext files for EditPlus to the Extras folder. [thanks Mike Griffin]
Added directive #Persistent, which keeps a non-hotkey script running until ExitApp is encountered (useful for scripts that contain only timers or custom menus).
Added the ability to show/hide the tray icon while the script is running. [thanks beardboy]
Added an option that allows the main window of a compiled script to become accessible. [thanks beardboy]
Added support for window class names to all windowing commands. Window Spy now reports the WinTitle you should specify to use a window's class. [thanks Rajat]
Added commands ControlMove, Control, and ControlGet, which retrieve and change various attributes of a control. [thanks AutoIt3 Team & Rajat]
Added commands FileRecycle and FileRecycleEmpty. [thanks AutoIt3 Team & Rajat]
Added command ToolTip. [thanks AutoIt3 Team & Rajat]
Fixed a small memory leak in Run and RunWait.
Fixed the Start Menu's launch of the main program: with older versions, it's possible that your AutoHotkey.ini script file (if you have one) was placed in the ShellNew folder of your Windows folder. If so, move it from there into the AutoHotkey directory in Program Files (or wherever you installed it).
Fixed the "Edit This Script" menu item, which disabled hotkeys if the script was already open for editing.
Fixed the fact that timers would sometimes make the tray menu and main menu slow to respond.
Fixed GetKeyState when retrieving the physical state of the mouse buttons: it was wrong whenever the mouse hook was installed without the keyboard hook. [thanks skrommel]
Fixed the tilde (~) hotkey prefix so that it works on all keys. [thanks Rajat]
Fixed the fact that the script would silently exit if a blank dynamic variable was used, such as in this example: %EmptyVar% = 100 ; [thanks Rajat]
Changed the tray icon to be closer to the intended green color on Windows 95/98/NT/2000.
Changed one of the types of buffering that was introduced in version 1.0.06 to default to OFF because it does more harm than good in most cases. See #MaxThreadsBuffer for how to re-enable this type of buffering and for an explanation. [thanks jamestr]
Improved #InstallKeybdHook and #InstallMouseHook to accept the optional word FORCE, which avoids the warning dialog that is normally displayed when the hook is already installed by another script. [thanks Rajat]
Improved ControlSend to optionally send directly to the parent window of a control. This is useful for programs such as Winamp 2.x (see Automating Winamp for an example). [thanks Rajat]
Added support for keyboards that have special keys not found on the key list. If your keyboard has such keys, you might be able to make them into hotkeys by using these steps (XP/2000/NT only). [thanks Rajat]
Added NumpadEnter to the key list since it can be made a hotkey on XP/2000/NT. [thanks Rajat]
Added support for hexadecimal integers. Use a 0x prefix to indicate that a number is hex (e.g. 0xF9
). Hex integers can be used anywhere that a decimal integer is expected; for example, Sleep, 0xFF
is equivalent to Sleep, 255
. You can also use SetFormat to make math operations store their results as hex, and to convert between decimal and hex. [thanks Rajat]
Added an option to the Installer that enables drag & drop onto script files. This option is disabled by default since it can lead to accidental launches. [thanks Rajat]
Added Rajat's TextPad syntax file and clip library to the Extras folder, which is accessible via the Start Menu. Use the included script to install these features. Hopefully, similar add-ons for other editors will be developed in the coming months (volunteers are welcome).
Added sub-command Menu Rename.
Added commands PostMessage/SendMessage.
Added command RunAs, which allows processes to be created under the permissions of a different user. [thanks Jonathan Bennett & Robert Yaklin]
Added command WinSet, which can make a window "always on top" or transparent.
Fixed the Send command on Windows 95/98/Me so that keys such as {Down}
, {Home}
, and {PgUp}
work properly. [thanks S_R]
Fixed the built-in variable A_ScriptDir so that .aut scripts see it as containing a final backslash (for compatibility). Also changed the .aut to .ahk converter so that this adjustment is made during the conversion. [thanks Rajat]
Fixed Send, {}}
(send a literal right-brace). [thanks Rajat]
Fixed silent exit when a shifted reserved symbol such as #
or ^
was defined as a hotkey. [thanks Rajat]
Fixed ShiftAltTab when it was assigned to a Numpad key. [thanks Rajat]
Changed the following commands so that they don't report runtime errors when given negative parameters: StringLeft, StringRight, StringMid, StringTrimLeft, StringTrimRight, ControlClick, and MouseClick. [thanks Rajat]
Changed the Suspend command so that hotkey subroutines whose first line is Suspend, On
are not exempt from suspension. [thanks Jay D. Novak]
Changed MsgBox so that it will default to displaying "Press OK to continue" only when called explicitly with zero parameters. [thanks Rajat]
Changed the program's icons to the stylish ones provided by Rajat. It's hard to please everyone with a change like this, but hopefully most of you will consider them to be improvements over the drab originals (which basically just involved me drawing a big purple H).
Improved RegRead, RegWrite, and RegDelete so that they support a key's default value, which is displayed by RegEdit as "(Default)". Also, the root key names can now be abbreviated (e.g. HKLM). [thanks Rajat]
Added command Menu, which allows you to customize the script's tray icon menu by removing existing items or adding new items. [thanks beardboy & Rajat]
Fixed the following issues specific to Windows 95/98/Me [thanks Jay D. Novak]:
#+a::Send, hello
would incorrectly send HELLO in uppercase.Send, {NumLock}
should now work more reliably.Fixed the tray icon so that it doesn't stay black when a new hotkey subroutine is launched while the current thread is paused. But it will go back to being black when the new subroutine finishes.
Fixed Gosub and Goto that jump to a label whose name is contained in a variable reference. In this example, the variable will now be resolved each time the line is run rather than only the first time: Gosub, %MyLabel%
Fixed the keyboard hook so that it is always auto-installed in response to #InstallKeybdHook and for scripts that contain only non-standard hotkeys such as CapsLock & e::
. [thanks bobhurt]
Changed the Installer to: 1) register the EXEs that come with the program so that you don't need to specify a full path when running them directly; 2) create its program group in All Users rather than the current user; 3) correctly remember the last installation directory (if you're installing on top of an older version).
Changed program startup for scripts that use the keyboard hook so that the current state of Ctrl/Alt/Shift/Win is taken into account.
Changed the auto-execute section so that if it takes a long time to complete (or never completes), the default values for settings such as SetKeyDelay are put into effect after 100 milliseconds. Thus, it's usually best to make any desired changes to the default values at the top of the script. This is only important for scripts that contain hotkeys or timers.
Improved SetBatchLines to optionally accept a number of milliseconds rather than a number of lines. The millisecond method is recommended for scripts whenever speed and cooperation are important. For example, on most systems a setting of 10ms will prevent the script from using any more than 50 % of an idle CPU's time. This allows scripts to run quickly while still maintaining a high level of cooperation with CPU sensitive tasks such as games and video capture/playback.
Improved hotkey buffering during critical operations (such as Send), and when a hotkey's #MaxThreadsPerHotkey setting has been reached. In other words, in most cases, the program will save up hotkey presses until they can be executed. As a side-effect, this makes holding down a hotkey (to auto-repeat it) more responsive. [thanks Jay D. Novak]
Improved the performance of hook scripts that have high or infinite BatchLines.
Added the AutoScriptWriter (macro recorder) to the main installer. I think there's a problem with the save button (which will hopefully be fixed soon) but it seems to work fine otherwise. [thanks Larry Keys]
Added command SetTimer, which is where most of the development time was spent over the past 10 days. Timers are useful because they run asynchronously, meaning that they will run at the specified frequency (interval) even when the script is waiting for a window, displaying a dialog, or busy with another task. Possible uses for timers include taking some action when the user becomes idle (as reflected by %A_TimeIdle%) or closing unwanted windows the moment they appear. There are many other potential uses.
Fixed possible crash of the Exit and ExitApp commands.
Fixed Ctrl+Alt+Del on Windows 2000/NT so that Ctrl and Alt aren't thought to be down upon returning. [thanks Julian Doak]
Fixed GetKeyState so that the physical state of the mouse buttons is properly reported when the mouse hook is installed.
Fixed StringLower so that it accepts the optional T (title case) parameter as intended. [thanks beardboy]
Changed clipboard handling so that the program will keep trying to open the clipboard for 800 rather than 400 milliseconds before giving up and displaying a warning dialog. [thanks Jason Payam Ahdoot]
Changed: Variable names are now listed in alphabetical order in the main window. As a side-effect, performance of arrays is now better.
Changed FileAppend so that it optionally allows the file to be written in binary vs. text mode. As far as I know, the only consequence of this is that newline (`n) will be written as an isolated linefeed (LF) rather than a carriage return + linefeed (CR+LF).
Improved InputBox to allow a custom size and position to be specified. In addition, the window can now be resized by dragging its borders. [thanks David Nuttall & beardboy]
Added support for {Sleep}
to the Send command. Also added Sleep as an allowed hotkey, though Sleep on some keyboards might not be compatible with this.
Added built-in variable %A_Index%, which is the number of the current loop iteration. The first iteration is 1, the second is 2, etc.
Added built-in variable %A_IdleTimePhysical%, which is similar to %A_IdleTime% except that it ignores artificial input (the kind generated by scripts and programs), and thus may be more useful for detecting whether the user is truly present. This variable will be the same as %A_IdleTime% unless the keyboard or mouse hook (or both) is installed.
Added command StringSplit, which divides a string into an array of substrings using the specified delimiters.
Added new type of loop: string-parse. It retrieves substrings (fields) from a string one by one (similar to StringSplit but uses less memory).
Added new type of loop: file-read. It reads the contents of a file (line by line) with higher performance than FileReadLine.
Fixed Win+L (hotkey to lock the computer) so that Win is not considered to be down when you log back in. [thanks Jack Horsfield].
Fixed the Reload feature: If a MsgBox or other dialog was displayed by the script at the time it was reloaded, the application would hang. [thanks Christian Ziemski]
Fixed auto-execute section, which is the top part of the script prior to the first hotkey label: If it had at least one normal (non-hotkey) label, in some cases the script's first hotkey label (if it had one) was executed as part of the auto-execute section. [thanks Robert Yaklin]
Improved SoundSetWaveVolume to accept +/- as a prefix. These prefixes adjust the volume up or down relative to its current level. In addition, the command now accepts an optional 2nd parameter to indicate which device to operate upon (for systems with more than one sound device).
Improved the following commands to greatly reduce the keyboard and mouse lag caused by a hook-script performing a long operation: FileDelete, FileCopy, FileMove, FileReadLine, FileSetAttrib, FileSetTime, Send, and ControlSend.
Improved StringLower/Upper to support converting a string to title case. For example, "GONE with the WIND" would become "Gone With The Wind".
Added remote registry support to registry loops, RegRead, RegWrite, and RegDelete. Simply prepend the computer name to the root key, as in this example: \\workstation01:HKEY_LOCAL_MACHINE
Added built-in variable %A_TimeIdle%, which is the number of milliseconds since the system last received keyboard, mouse, or other input. This is useful for determining whether the user is away. This variable will be blank unless the operating system is Windows 2000, XP, or beyond.
Added command UrlDownloadToFile, which downloads a file from the Internet. [thanks Jonathan Bennett & Jason Payam Ahdoot]
Added command SoundGetWaveVolume, which retrieves the current wave output volume level.
Added commands SoundGet and SoundSet, which allow just about any setting of any sound device to be retrieved or changed. Examples include mute, microphone, master, synth, aux, and line-in.
Fixed Send {Asc nnnnn} so that leading zeros in nnnnn are not ignored.
Fixed RShift (right Shift): Hotkeys that involved it sometimes created an incorrect shift-state. [thanks Jesper James Jensen]
Changed the default HotkeyModifierTimeout from 100 to 50 to alleviate sticking modifier keys (Ctrl, Alt, Shift, and Win). [thanks Jesper James Jensen]
Changed FileCopy for AutoIt2 (.aut) scripts so that it sets ErrorLevel to 1 rather than the number of files that could not be copied (improves compatibility).
Added command FileCreateShortcut, which creates a .lnk file. [thanks Jonathan Bennett]
Added support for registry enumeration, which allows the contents of a key to be retrieved (item by item) via a registry loop. RegRead, RegWrite, and RegDelete have also been enhanced to optionally use the loop's current registry item whenever they are enclosed in a registry loop. [thanks Robert Yaklin]
Fixed a bug introduced in the prior version: In rare cases, you had to release and press down a hotkey's modifiers (Ctrl, Alt, Shift, and Win) to get them back into effect after a Send operation. This is now unnecessary in most cases.
Changed: The program will now launch even if its tray icon cannot be created (perhaps due to running a shell other than Explorer). [thanks Ian Oliver]
Changed program startup so that the currently active window is not disturbed (it will stay active).
Improved the Send command to support the characters ø
and Ø
. [thanks Jesper James Jensen]
Fixed EnvSub's date-time math so that if a newer time is subtracted from an older one, the result will be reported correctly as a negative number rather than a large positive number.
Fixed a rare problem with naked modifier keys used as hotkeys. For example, if RControl (by itself) was a hotkey, sometimes Ctrl would get stuck down after a Send operation that involved Ctrl.
Fixed syntax error reporting: in rare cases such as Else If statements, the line above where the syntax error actually occurred was reported.
Added the built-in variable %0%, which contains the number of command line parameters that were passed into the script. This also improves compatibility with AutoIt2. [thanks BoBo]
Added command BlockInput, which prevents the user from doing anything with the keyboard, mouse, and maybe other input devices as well. [thanks Jonathan Bennett & beardboy]
This seems like a stable version. I've had a lot of help testing it, so thanks to you all, especially Robert Yaklin. There are many more enhancements planned; you can expect the first in a series of new releases in about 2 weeks. Now on to the changes...
Fixed several problems with number recognition, mainly that numbers are now allowed to start with a plus sign or decimal point. For example, .95
, -.95
, and +.95
are now considered to be floating point numbers. [Thanks to Romano]
Fixed ListLines crashing when it displayed commands whose optional output variables were omitted.
Fixed a rare crash condition involving large variables being given a value that has zero length.
Fixed Reload on Windows 95. [Thanks to Robert Yaklin]
Fixed IF statements so that operators do not need to have whitespace. For example, this is now valid as intended: if var<>0
Fixed (again) shift key sticking when used with Numpad keys. Hopefully this is close to a 100% fix. [thanks Robert Yaklin]
Fixed RegRead of REG_BINARY values: ErrorLevel is now set to 0 when successful.
Fixed RegWrite of a blank REG_DWORD value: It now writes a zero rather than a random number.
Changed SplashTextOn: Removed the menu bar from the window, which was unintentionally introduced in the previous version. Also, on most systems, the window will be a few pixels wider and taller so that the border is always correctly shown. [thanks Jonathan Bennett and Robert Yaklin]
Changed SetFormat so that specifying 0
is the same as specifying 0.0
. [thanks Robert Yaklin]
Changed commands that activate a window, such as WinActivate, so that they won't hang if the previously active window or the target window is hung. Also, these commands will now try a more gentle approach first. You can skip the gentle approach by using #WinActivateForce, which maybe be useful in preventing task bar buttons from flashing when different windows are activated quickly one after the other.
Changed IniWrite and IniDelete so that they set ErrorLevel to 1 if there was a problem or 0 otherwise. For compatibility reasons, this does not apply to AutoIt2 (.aut) scripts.
Improved RegRead and RegWrite to fully support REG_MULTI_SZ. [thanks Jonathan Bennett]
Improved ControlClick: It now clicks the exact center of the control, which might improve reliability for some types of controls. Also, another change was made (SetActiveWindow) that might further boost reliability. Finally, a new optional parameter was added that allows the mouse button to be held down or released. [thanks Jonathan Bennett]
Improved Send to handle the following characters: ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ£ƒáíóúñѪº¿¬½¼¡«»
[thanks Jonathan Bennett]
Improved Send and ControlSend so that any key can be held down or released. Example: Send, {tab down}{b down}{b up}{tab up}
Improved ControlSend so that the sending of Shift, Ctrl, Alt, and Win is more reliable. [thanks Jonathan Bennett]
Improved FileRemoveDir to optionally delete recursively (similar to deltree). [thanks Jonathan Bennett]
Improved FileCopy so that it sets ErrorLevel to the number of files that could not be copied (zero if all requested files were copied). The copy operation continues even if error(s) are encountered (such as target file(s) already existing when the overwrite flag is OFF).
Improved FileMove to support wildcards and to behave like FileCopy for ErrorLevel and continue-on-error. However, it no longer supports the moving of directories. Use FileMoveDir instead. [thanks Jonathan Bennett]
Improved FileSelectFile by adding two optional parameters: Prompt (display instructions for the user) and Filter (for example: *.txt
). As with all new parameters for old commands, they are not available in scripts whose file extension is .aut (for compatibility reasons).
Added FileCopyDir and FileMoveDir. [thanks Jonathan Bennett]
Added built-in variable A_Tab, which contains a single tab character (similar to A_Space).
Added new types for "if var is <type>": integer, digit, alpha, alnum, and space.
I'm hoping this can be the final beta prior to initial release. All the test scripts run fine, including complex scripts that run for 72+ hours continuously without any memory leaks or other problems. The only significant fixes remaining are for ControlSend (uppercase vs. lowercase problems) and FileMove (wildcard support). If you get time over the next few days, please try to give this latest version a workout, especially the below changes and additions.
Fixed FileSelectFile: Sometimes the dialog would not be displayed, usually when doing a multi-select. [thanks to Steve Drown]
Fixed (hopefully) a hang-on-exit when the script is terminated while it is displaying a MsgBox or other dialog (rare even then).
Fixed #InstallKeybdHook and #InstallMouseHook so that they force the hooks to be installed even if there are no hotkeys that need them. This is useful to expand the scope of what the KeyHistory command shows.
Customized the AutoIt3 Window Spy to show which window text is available only when SetTitleMatchMode is in the "slow" mode. It also omits the mouse's desktop coordinates since they aren't used by AutoHotkey.
Changed the KeyLog command:
Renamed command ControlLeftClick to ControlClick so that other mouse buttons are supported. A simple search and replace of ControlLeftClick with ControlClick in your scripts should do the trick because the command assumes the left button if none is specified.
Improved the SHIFT-NUMPAD issue: Shift shouldn't get stuck down as often when used with any of the dual-state numpad keys. This is a compensation for the keyboard's driver-generated Shift events, which ensure that Shift isn't logically down whenever a numpad key is pressed or released. [thanks to Robert Yaklin]
Added command SetMouseDelay to change the delay that occurs after every mouse movement or click. Default 10.
Added directives #MaxThreads and #MaxThreadsPerHotkey. The latter defaults to 1, which means that new instances of a hotkey subroutine cannot be launched if that subroutine is already running. This default behavior is what most people would want since it helps prevent accidental double-presses. Thus, there's probably no need to change any of your scripts.
Added command FileInstall, which includes extra files when compiling a script.
Added #Include directive: By default, files are included only once, even if multiple inclusions are encountered. Use #IncludeAgain to include a file more than once.
Added menu bar to the main window for convenient access to features such as viewing variables, lines, hotkeys, and key history.
Changed (again) math operations that involve impure numbers (e.g. 123abc
) so that they conform to AutoIt2's behavior: Strings that start with a number are that number for the purpose of the calculation, e.g. 123abc
is considered to be 123
. Strings that do not start with a number are considered to be zero for the calculation, e.g. 123 + abc = 123
. This change does not affect the behavior of IfEqual, IfGreater and IfLess: They will still compare strings alphabetically if either one is not purely numeric, which is slightly different from AutoIt2.
Added syntax to support determining whether a variable contains a pure number, floating point number, or time. Example:
if var is [not] number if var is [not] float if var is [not] time { ...actions to take... }
Fixed math operating on numbers that had trailing spaces: If a variable contained something like 123
(i.e. space at the end) it would be considered non-numeric when math was performed on it, thus resulting in the variable being made blank. Sorry if that messed up anyone; the prior release is what broke it.
Fixed for Windows 95: Retrieving environment variables should work now. The problem was caused by Win95's undocumented buffer size limit in GetEnvironmentVariable(). [Thanks to Robert Yaklin]
Fixed RWin (right Win): When used with a hook hotkey, it might have caused the Start Menu to appear.
Removed an unintended 10ms delay during the launch of every hotkey [introduced in v0.2.20].
Changed math operations (EnvAdd/Sub/Mult/Div) so that the output variable is made blank if either of the inputs is not purely numeric. In addition to making flawed scripts fail in a more consistent way, this behavior can be used to quickly determine whether or not a variable is purely numeric.
Improved RegRead and RegWrite to support REG_BINARY. [As with so many other things, thanks to Jon, the AutoIt author]
Improved the handling of ALT keys: if either of them is used as both a prefix (modifying other hotkeys) and a suffix (is itself a hotkey whose action fires when the key is released), it doesn't have the side-effect of invoking a menu on the active window. Strangely, this was never a problem on my system until today when some mysterious change occurred making it obvious this adjustment was needed.
Added support for floating point: Any number containing a decimal point is considered to be such. Any math operation involving at least one floating point number will produce a floating point result. In addition, the Random command has been improved to optionally generate floating point numbers. Note: integer math is still used whenever floating point numbers aren't involved because testing reveals that scripts with math intensive loops run over 5 times faster with 64-bit integers vs. floating point numbers (tested on Pentium II and Athlon XP).
Switched from 32 to 64-bit integer math. 32-bit is only about 40% faster than 64-bit for scripts running intensive math loops on Pentium IIs and Athlon XPs. But for real-world scripts, the difference is negligible, so the greater flexibility seems worth the cost. 64-bit also allows %A_TickCount% and DWORDs read from the registry to be correctly reported as positive, as well as enabling the retrieval of the exact number of bytes in files larger than 2 gigabytes.
Added command SetFormat to allow floating point numbers to be stored in a format other than the default (e.g. with blank padding, 0-padding, or a different number of decimal places).
Added Explorer right-click >>New >>AutoHotkey Script.
Fixed a Loop bug introduced in the prior version: If a Loop was directly beneath an IF or ELSE (i.e. not enclosed in a block), the flow of execution would be wrong, usually resulting in parts of the script being erroneously executed twice. [thanks to Steve Drown]
Fixed the custom icon feature of the Ahk2Exe script compiler.
Variable names may now contain the following punctuation (previously, only underscore was allowed): # _ @ $ ? [ ]
Documented the fact that MsgBox supports having a default button other than the first (256 = 2nd, 512 = 3rd).
Added the ability to compare, add to, and subtract from dates and times. This is done via an optional 3rd parameter for EnvSub and EnvAdd, which can be either Seconds, Minutes, Hours, or Days (or just the first letter of each of these). The date-time format is YYYYMMDDHH24MISS, which is used by all date-time commands. Example:
var1 = 20050126 var2 = 20040126 EnvSub, var1, %var2%, days MsgBox, %var1% ; The answer will be 366 since 2004 is a leap year. var1 = ; Make it blank so that the below will use the current timestamp instead. var1 += 31, days MsgBox, %var1% ; The answer will be the date 31 days from now.
The first draft of the help file and the installer are finally done. They're included in the current release. [Thanks to Robert Yaklin for his help with the installer.] The installer will associate .ahk files with the installed AutoHotkey.exe, rather than any old version you may have.
Fixed a bug introduced in 0.216 that prevented #HotkeyModifierTimeout from working correctly. Scripts that didn't have the keyboard hook installed would not properly compensate for keys the user was physically holding down during the Send command.
Fixed RegDelete so that it allows the 3rd parameter (ValueName) to be omitted. If omitted, the entire specified subkey will be deleted.
Fixed script compiler (Ahk2Exe) crashing when given a custom icon. However, the custom icon feature still doesn't work. Hopefully it will be working for the next release.
Removed the GroupCloseAll command. Instead, use GroupClose, MyGroup, A
.
Changed IfWin[Not]Active and WinWait[Not]Active so that they set the Last Found window. [Thanks again to Robert]. If any of your scripts use the Last Found Window feature, there's a small chance they'll need to be changed in light of this.
Changed the default WinDelay to 100 vs. 250, and the "default" DefaultMouseSpeed to be 2 vs. 10 (i.e. the mouse will move faster by default). AutoIt2 (.aut) scripts still use 500 as their default WinDelay, but now use 2 vs. 1 as their default mouse speed (since Jon has said that values less than 2 sometimes don't work with MouseClickDrag). If anyone thinks these may be too aggressive, let me know.
Improved MsgBox with smart comma handling: Commas do not need to be escaped (`,
) anymore except when using the command's timeout feature.
Improved the KeyHistory command: It will now show the script's own generated keyboard events in the window (rather than nothing) when the keyboard hook isn't installed.
Improved RegRead by eliminating the 2nd parameter (ValueType) whenever the command is given only 4 parameters. When given 5 parameters (i.e. the old style), the 2nd parameter -- which is not used and is present only for backward compatibility with AutoIt2 -- can be left blank.
Improved the responsiveness of the program (tray menu, main window, etc.) when SetBatchLines is very high or infinite. This also reduces keyboard and mouse lag to negligible levels if such scripts use the keyboard or mouse hook.
Improved FileSetAttrib and FileSetTime so that they optionally recurse into subfolders. Although all subfolders are recursed into, even if their names don't match the wildcard pattern, the attributes of the subfolders themselves are not changed unless OperateOnFolders is 1 and the folder name matches the pattern (*.*
matches all).
Improved file loops by adding an automatic "recurse into subfolders" option and more.
Added command SetControlDelay. This is just like SetWinDelay except it defines the delay that will occur after every control command that changes a control, namely ControlClick, ControlFocus, and ControlSetText. These commands are somewhat unreliable due to their nature; this delay seems to alleviate that. It defaults to 20 (milliseconds). In older versions, the value of SetWinDelay was used for these commands.
Added command SoundPlay. In addition to .wav files, it may be able to play .mp3, .avi, etc. depending on what features are installed on your OS.
Added ++
and --
operators, which add or subtract 1 from the target variable. Examples: count++
, ++count
, count--
, --count
Added support for arrays (AutoIt2 style). This was done by allowing the name of a variable to be resolved during runtime, rather than exclusively at compile-time as it was before. In other words, commands that expect the name of a variable (with no enclosing %%) now allow that variable name to contain references to other variables. Example:
; Write to the array: i = 0 loop, 5 { i++ Random, array%i%, 1, 100 ; Put a random number into each element. } ; Read from the array: i = 0 loop { i++ StringTrimRight, element, array%i%, 0 if element = break ; The end of the array has been reached. MsgBox, %element% }
Fixed the Suspend command so that when suspension is turned off, all hotkeys are re-enabled. Previously, hotkeys handled by the hook were sometimes left disabled.
Changed the Suspend command so that the keyboard and mouse hooks are never removed if the corresponding directives (#InstallKeybdHook and #InstallMouseHook) are present in the script.
Changed InputBox: For non-AutoIt2 (.aut) scripts, it now sets ErrorLevel to 1 and the output variable to the value entered if the user presses the Cancel button. For AutoIt2 scripts, the behavior is the same: ErrorLevel is not changed, and the output variable is set to blank whenever the user presses Cancel, even if text was entered.
Changed FileDelete to set ErrorLevel to be the number of files that could not be deleted (if a wildcard pattern was given).
Changed the KeyHistory command so that the filename is specified in the second parameter. So now it works this way:
KeyHistory ; same as before (display short log in window) KeyHistory, on, c:\KeyHistory.txt ; Turn on logging, optionally specifying the file to log to. KeyHistory, off ; Turn off logging. KeyHistory, toggle [, filename] ; Toggles to the opposite state (on or off).
Improved the performance of KeyHistory when it logs to a file by having it leave the file open rather than closing and reopening it for every key/mouse event. This should also reduce wear & tear on the drive. The only disadvantage is that viewing a log file that is open for logging might show contents that are out-of-date due to file buffering. To work around this, temporarily turn off logging before viewing the file.
Improved the performance of Run and RunWait by having them attempt CreateProcess() prior to ShellExecute(), rather than the other way around. I believe CreateProcess() is much faster.
Removed the commands FileToggleHidden and FileSetDateModified. See below for their replacements.
Added the following commands. Click a link for details:
Added a script compiler (makes an EXE from a script) by popular demand. It was a lot easier than I thought, thanks to Jon's (AutoIt author's) open & modular coding style. It's available on the download page. Note: Presently, .aut scripts are not supported because there's no way for the compiled script to figure out whether to run in AutoIt2 mode (backslash as escape char) or AutoHotkey mode (`
as escape char). So if necessary, first auto-convert your .aut file to .ahk by renaming it to "whatever.aut.ahk" and then running it with AutoHotkey.exe.
Added support for command line parameters becoming script variables. The command line format is:
Added command #NoTrayIcon. Put it anywhere in a script to disable the showing of a tray icon. If you use this for a script that has hotkeys, you might want to bind a hotkey to the ExitApp command. Otherwise, there will be no easy way to exit the program (without restarting the computer or killing the process). Example: #x::ExitApp
Fixed variable assignment (SetEnv and the new style, var = value
) to properly handle escape sequences. Lines such as this should now work properly: result = %result% %color% `%`n
Fixed Shift getting stuck down in rare cases when Numpad hotkeys invoke the Send command to send Shift. The fix is basically a workaround for the fact that the OS, driver, or BIOS generates physical shift-key events to ensure that Numpad keys that have a dual-state (Numpad1-9 and Dot) never have their keystrokes occur while Shift is down. Thanks once again to Robert Yaklin for his help on tracking this down.
Fixed Numpad hotkeys (e.g. NumpadEnd) that have a counterpart on the main keyboard (e.g. End) so that the counterpart key does not fire the hotkey.
Added commands IniRead/Write/Delete:
Added command EnvUpdate, which according to the AutoIt3 docs: "Refreshes the OS environment. Similar effect as logging off and then on again." The command sets ErrorLevel to 0 to indicate success or 1 otherwise. Note: Due to the nature of this feature, there is a slight chance that keyboard and mouse events will lag (be delayed) while the command is running if the keyboard/mouse hooks are installed.
Added a built-in variable A_Space which contains a single space character. This avoids the need for a workaround to get a variable to contain a space. Example:
String = String with spaces IfInString, String, %A_SPACE% MsgBox, A space was found. ; But to assign a naked space to a variable of your own, be sure to turn off AutoTrim so that the assignment won't remove all leading and trailing spaces: AutoTrim, off MySpace = %A_SPACE%
Added the Edit command, which opens the current script for editing, or activates an existing Editor window if it finds one it thinks may have the file open based on its window title. This command is the same feature as selecting "Edit This Script" from the tray menu.
Added the Pause command and corresponding tray menu item. Unlike Suspend -- which disables hotkeys entirely -- pause will freeze the currently running subroutine (if none, pause will have no effect). The allowed values for the command's first parameter are ON, OFF, and TOGGLE (change to the opposite state). If the first parameter is omitted, it will default to TOGGLE just like the Suspend command. New hotkeys can still be launched while the script is paused, but when their subroutines finish, the underlying interrupted subroutine will still be paused. The Pause, off
command will unpause only the most recently paused subroutine. Each subroutine can be paused independently of the others. The color of the tray icon changes to black whenever the script's current subroutine is in a paused state.
Improved the Suspend feature:
Improved the behavior of #SingleInstance scripts when the user attempts to run another instance: The user is now prompted for whether to keep the original instance or replace it with the new one.
Improved PixelSearch by making the output variables optional. In addition, an optional parameter has been added, which if present is a number between 0 and 255 (inclusive) to indicate the allowed number of shades of variation in either direction for the intensity of the red, green, and blue components of the color. This can be helpful if the color you're looking for isn't always exactly the same shade. Example: PixelSearch, FoundX, FoundY, %X1%, %Y1%, %X2%, %Y2%, %Color%, 10 ; Allow 10 shades of variation
. Note: If you specify 255 shades of variation, all colors will match. The default is 0 shades.
Fixed a bug introduced in a prior version that prevented new hotkeys from firing if the script had a MsgBox or other dialog displayed on the screen.
Fixed PixelSearch to accept negative coordinates without complaining.
Changed the behavior of scripts so that the default values of things such as KeyDelay and WinDelay will go into effect for every newly launched hotkey subroutine. You can use the auto-execute section -- which consists of the commands at the top of the script that occur prior to the first hotkey label -- to change any of the defaults that you wish. So now, when you press a hotkey, the subroutine will always start off fresh with the default values of the following:
Added StringUpper and StringLower. Example: StringUpper, OutputVar, InputVar
. Note: As with all such commands, InputVar and OutputVar are allowed to be the same variable.
Added the following built-in variables:
#c
) of the hotkey subroutine most recently launched. It's blank if none.Fixed a possible crash in variable assignments that involve more than one source, e.g. statements such as clipboard = %clipboard%%SomeVar%
.
Fixed a possible crash-on-startup bug introduced in version 0.212 in conjunction with "else if" support.
Fixed clipboard being hogged (held open) in rare cases such as displaying the clipboard with SplashTextOn.
Fixed PixelGetColor to accept negative coordinates without complaining.
Fixed a very obscure issue where a non-suppressed mouse hotkey such as ~LButton::
would cause that particular AutoHotkey instance's tray menu and main window context menus to behave strangely.
Added command SoundSetWaveVolume, which sets the playback volume for files such as WAV and MP3. For example: SoundSetWaveVolume, 50 ; Number between 0 and 100, inclusive
.
Added command EnvSet, which is needed because unlike AutoIt2, AutoHotkey does not store its variables in the environment. This is because performance would be worse and also because the OS limits environment variables to 32 KB (AutoHotkey variables, including the clipboard, are essentially unlimited in size). ErrorLevel is set to 1 if there was a problem or 0 otherwise. For example: EnvSet, AutGUI, Some text to put in the variable
.
Note: An EnvGet command is not necessary because dereferencing a blank or undefined variable will automatically trigger that behavior. For example, in the following line, the value of the ProgramFiles variable (if undefined in the script) will be fetched from the environment: TargetFile = %ProgramFiles%\Something\setup.ini
Disabled the feature that jumps to the proper line in notepad or metapad when a syntax error is found (if the script is already open in such an editor) because it doesn't seem to work reliably. If any of you were using it, let me know. Later, I plan to add support for an external script such as "RunWhenSyntaxError.ahk" that will automatically be run if a script launch fails due to a syntax error.
Improved PixelSearch to set ErrorLevel to 2 if there was an error other than "color not found". It still sets it to 1 if the color isn't found, or 0 if it is.
Added command WinMenuSelectItem (similar to AutoIt3 command). The menu search terms are not case-sensitive (i.e. File->Save is the same as file->save) and the use of ampersand (&) to indicate the underlined letter in a menu item is not necessary. For example:
WinMenuSelectItem, Untitled - Notepad, , File, Save WinMenuSelectItem, Untitled - Notepad, , 1&, 3& ; Same as above but uses menu item position rather than text.
Note: The position method exists to support menus that don't contain text (perhaps because they contain pictures of text rather than actual text). Position 1 is the first menu item (e.g. the File Menu). Menu separator lines count as menu items for the purpose of determining the position of a menu item.
Added command ControlFocus. For example:
ControlFocus, (ControlName or ControlClassNN), WinTitle, WinText, Excludetitle, Excludetext
Note: As with all commands that take WinTitle/Text, you can specify the letter A as the title to use the active window, or leave all 4 window parameters blank to use the window most recently found by commands such as IfWinExist and WinWait.
Improved the following commands so that they set ErrorLevel to 1 if there was any kind of non-critical error (such as a nonexistent window or control) that prevented the command from completing: ControlSend, ControlClick, ControlSetText, ControlGetText, StatusBarGetText, WinGetText.
Improved StatusBarWait so that it sets ErrorLevel to 2 if there was some kind of error (e.g. the target window doesn't exist or doesn't have a status bar). But as before, ErrorLevel will be set to 1 if the command times out or 0 if the status bar becomes a match for the specified text.
Improved the KeyHistory command to support logging keys & mouse buttons to a file. It still works the old way (displaying the KeyHistory window) if no parameters are given. But it behaves differently if given a first parameter. Examples:
KeyHistory, C:\KeyHistory.txt ; Specify the filename and turn on file logging. KeyHistory, off ; Turn off file logging. KeyHistory, on ; Turn on file logging to the filename specified by a prior use of this command. KeyHistory, toggle ; Toggle logging (set it to the opposite of its previous state).
The keyboard or mouse hook must be installed for logging to occur. You can force them to be unconditionally installed by adding the following lines to your script:
#InstallKeybdHook #InstallMouseHook
The log file is a tab-delimited text file with the following fields:
Sample log file:
59 015 15.0 u Y C:\ 5B 15B 0.1 u Left Windows 9E 000 1.1 d WheelDown 9F 000 0.4 d WheelUp A4 038 0.4 d Alt 09 00F 0.1 d Tab 09 00F 0.2 u Tab A4 038 0.1 u Alt Untitled - Notepad A3 11D 1.4 d Right Ctrl 26 148 0.1 h d Up C:\ 26 148 0.1 s u Up A3 11D 0.0 u Right Ctrl A3 11D 1.6 d Right Ctrl 2E 153 0.1 h d Delete A3 11D 0.0 i u Right Ctrl A4 038 0.0 i d Alt 73 03E 0.0 i d F4 73 03E 0.0 i u F4 A4 038 0.0 i u Alt A3 11D 0.0 i d Right Ctrl
Note: Each keystroke generates two lines, a down and an up.
Fixed hotkeys that have LWin/RWin (Win) as a modifier and that use the Send command: In some cases, Win was incorrectly put into the down position after the Send. [Thanks to Robert Yaklin for discovering this.] On a related note, you do not need to use the Sleep command to allow the user time to release the modifier keys (Ctrl, Alt, Shift, and Win) with hotkeys that use the Send command. The Send command knows to change the modifiers to what they need to be for every key that will be sent.
Fixed hotkeys that override Windows hotkeys such as Win+E and Win+R so that the Start Menu doesn't appear when Win is released.
Added PixelGetColor and PixelSearch, which mirror AutoIt3's commands of the same name. These can help with detecting the state of non-standard controls and with the automation of full-screen apps such as games. See docs for details.
Minor: Undid the previous change mentioned below having to do with "escape chars at the end of a line or that escape a whitespace char". To conform to AutoIt2 behavior, escape chars that don't escape anything are now removed (i.e. made invisible).
Minor: Changed WinClose to use the WM_CLOSE vs. SC_CLOSE (Alt+F4) method so that it's like AutoIt2 and AutoIt3. The new method is a little less gentle to the target window than the previous method, but it's likely to work on more types of windows.
There's now an automated way to convert a .aut file to .ahk so that you can take full advantage of the new features (some new features -- such as the new parameters available in some commands -- are disabled in .aut scripts to improve compatibility with AutoIt2). The conversion will simply make the escape character `
instead of \
. This is harder than it sounds due to the precise ordering of escape sequences in each line, which is why you just can't do a Search & Replace in a text editor. This automated way should take care of all the details:
.ahk
to the end of an existing .aut file, so that filename now ends in .aut.ahk
-NEW.ahk
. This is the converted version. The original version will be unchanged.After converting a script from .aut to .ahk, the main problem areas to check for are commands that accept additional parameters in .ahk files but not in .aut files. If you used any non-escaped commas in the parameter that was formerly the last parameter (in AutoIt2) but is now not the last parameter, those commas will be interpreted as delimiters. For example:
Msgbox, 0, Title, Text, with, commas
In the above, the string "Text, with, commas" would be interpreted as the last arg by AutoIt2. But since AutoHotkey supports a new parameter for the timeout of the MsgBox, the string "with, commas" would be interpreted as the timeout value (which would be caught as a load-time error in this case). Here is another example:
WinActivate, title, text with literal comma, here.
The above would be a problem after conversion; The string "here." would be interpreted as the new ExcludeTitle parameter.
Here is a list of commands that both accept new parameters and that might be problematic:
Note #1: Even though they accept new parameters in .ahk files, commands such as IfWinExist are not troublesome with respect to the above because the program can tell the difference between the AutoIt2 and AutoHotkey methods. The WinWait family of commands should also not be a problem.
Note #2: As always, AutoHotkey can run most AutoIt2 (.aut) files directly, without the need to convert to a .ahk file.
Added support for a command being on the same line as its ELSE. Examples:
if x = 1 Gosub, a1 else if x = 2 Gosub, a2 else IfEqual, x, 3 { Gosub, a3 Sleep, 1 } else Gosub, a4 ; i.e. Any command can be on the same line with an ELSE. ; Also OK: IfEqual, y, 1, Gosub, b1 else { Sleep, 1 Gosub, b2 } ; But this is illegal: if x = 1 { ; Invalid: This would compare X to the string "1 {" instead of treating { as the start of a block. Sleep, 1 MsgBox, test } ; A legal alternative: IfEqual, x, 1, { Sleep, 1 MsgBox, test }
The main use of the above is for "else if" ladders, which may increase the script's readability.
Relaxed the conditions that triggered the warning dialog "More than X hotkeys have been received in the last Y milliseconds" (thanks to CyberSlug for the idea) so that keyboard auto-repeat feature can be used on most systems without triggering a warning. In addition, you can customize this behavior by using the following directives:
#HotkeyInterval 2000 ; This is the default value (milliseconds). #MaxHotkeysPerInterval 50 ; This is the default value.
Care should be taken not to make the above too lenient because if you ever inadvertently introduce an infinite loop of keystrokes (via a Send command that accidentally triggers other hotkeys), your computer could become unresponsive due to the rapid flood of keyboard events. Example of an infinite loop of keystrokes: ^c::Send, ^c
.
If you want to do something like the above without triggering an infinite loop, add a $ to the hotkey definition (e.g $#y::
). The $ tells it to use the hook for the hotkey, which is smart enough to know not to treat our own SEND commands as a source for hotkeys. Using the hook has at least a couple of disadvantages, which is why it isn't always used: 1) Only one instance of the program at a time should have the hook installed; 2) It may very slightly impact system performance.
Improved the ~
(tilde) hotkey prefix (see docs) so that it works with modified hotkeys (i.e. those that require Ctrl, Alt, Shift, or Win to be pressed) as well as unmodified ones. The only exception is mouse buttons, which must be unmodified to be "non-suppressed".
Made all windowing commands support the letter A as the first parameter to indicate that the active window should be used. Even though the result is always "known" ahead of time for commands such as WinWait, WinActivate, IfWinExist, and IfWinActive (since by definition the active window is active and exists), this change makes things more consistent. For example, the first parameter can conditionally resolve to the letter A at runtime, thus increasing flexibility. In addition, this change also allows the Last Used Window to be reset easily such as in this example:
#y:: ; Win-Y Run, notepad WinWait, Notepad WinActivate ; Activate the window last found. ; ...Let's say some time has passed and we're no longer sure which window is the "last used" one. WinActivate, Notepad WinWait, a ; ***** Set the "last used" window to be the active window. ; Now we can do commands such as the below without specifying the window (better performance too): WinMinimize ControlSend, , Some text that will appear in notepad even if it isn't active (ControlSend can use the "last used" window; in addition it sends to the top-most control by default). WinMaximize WinActivate return
New command:
#HotkeyModifierTimeout 100 ; value in milliseconds, default 100
The above only has meaning if the script does not have the keyboard hook installed (you can see if your script uses the hook via the KeyHistory command). This is because the hook can keep track of which modifier keys (Alt, Ctrl, Win, and Shift) the user is physically holding down. For example:
^!a::Send, abcdefg
The above SEND requires that Ctrl and Alt be released so that the keys get sent properly. After the SEND completes, if the hook is installed, the program knows whether it can safely push back down Ctrl and Alt. But if not and the SEND finishes more than HotkeyModifierTimeout milliseconds after the hotkey subroutine began, the modifier keys will not be restored, and you will have to release and press them again if you wish to use them to modify the same (or another) key again. Note: You can set the value to be -1 so that it never times out, or 0 so that it always times out. Also, you can ensure that the keyboard hook is installed, thus making the above unnecessary, by adding the line #InstallKeybdHook anywhere in the script. Reducing KeyDelay (via SetKeyDelay) to 0 or -1 may also help if the keyboard hook isn't installed, since SEND will run more quickly.
Fixed unjustified warning dialog ("Another instance of this program already has the keyboard or mouse hook installed") that sometimes occurred when using the "Reload This Script" function. This was apparently caused by OS being slow to unload the prior instance & mutex from memory. The program now does not display this warning if a currently-running script is being restarted.
Added $ as a hotkey modifier symbol (e.g. $^c::
): It results in the use of an alternate (more powerful) method to implement the hotkey. Use this if the default method doesn't work properly (due to its recursive use of the Send command, for example). In technical terms, this method uses the keyboard hook rather than RegisterHotkey() to implement the hotkey.
Fixed GetKeyState so that all keys work. Previously, keys with numpad equivalents, such as Del and End, didn't work.
GetKeyState now supports an optional 3rd arg that can be the letter T (state of toggleable key such as CapsLock) or P (physical state of key). If the arg is omitted or blank, the logical state of the key will be returned. The logical state should be one that the OS and the foreground app believe the key to be in, whereas the physical state is whether the key or mouse button is physically down or up. For example:
GetKeyState, state, CapsLock, T ; Will set "state" to be D if CapsLock is ON or U otherwise.
Currently, the "physical" state is always the same as the logical state if the hooks aren't installed, because Windows XP (and probably NT/2k, but perhaps not Win9x) doesn't seem to properly implement the following code. If anyone has a workaround, I'd love to hear it:
#define IsPhysicallyDown(vk) (GetAsyncKeyState(vk) & 0x80000000)
The keyboard hook is installed to support left/right-modifier specific hotkeys, wildcard hotkeys, SetNum/Scroll/CapsLock, AlwaysOn/Off, to override Windows Explorer hotkeys such as Win+E, and for a few other purposes. It is not unconditionally installed because it very slightly impacts system performance and is also only not designed to be used by more than one script at a time (though you can force it). You can determine which hooks (mouse and keyboard) are installed by assigning the KeyHistory command to a hotkey.
You can force the hooks to be installed unconditionally by adding either or both of these lines anywhere in the script:
#InstallKeybdHook ; this is the hook needed to maximize reliability of modifier restoration with the Send command (see above) #InstallMouseHook ; this would probably only be used if you wanted to see mouse button events in the KeyHistory, since it will automatically be installed if you are using any mouse hotkeys.
For the Send command, changed the name of ControlDown/Up to CtrlDown/Up so that it matches AutoIt. Also added LCtrl and RCtrl as alternate valid key names for LControl/RControl for use with hotkeys as well as commands such as Send and GetKeyState.
Fixed SEND so that if modifier keys are sent that happen to be part of the hotkey definition itself, those modifiers are restored after the Send is complete. This resolves issues where if KeyDelay was greater than -1, you would have to release the modifiers and press them down again to get the same hotkey to fire again after the first time. For example:
^+0::Send, {SHIFTDOWN}a{SHIFTUP}
Another thanks to CyberSlug for discovering this problem. See other sections above for further details.
Changed ControlSend so that {ASC nnnn}
items are ignored, since the OS does not support this feature when sending keystrokes directly to a window or control.
Fixed the Send command, which was sometimes sending an incorrect scan code (usually inconsequential).
Minor change: A modifier's key-up hotkey action (if it has one) won't fire if that modifier was used to modify any mouse button click (since Ctrl+LeftClick, for example, is a valid native OS feature that most users would never want to sacrifice).
Minor change: Escape characters that occur at the very end of a line or that "escape" a whitespace character are now considered to be literal. This should be more like AutoIt2. Example: var1 = this character is now literal -->`
Tip: C-style section comments can be used, but the symbols must appear at the beginning of a line to be recognized:
/* ... (section that is commented out) ... */
Fixed the Reload command and the corresponding tray menu item to work with script filenames that contain spaces.
Added GetKeyState. For example:
GetKeyState, OutputVar, LButton
It sets OutputVar to be U (for up), D (for down), or blank if the state couldn't be determined for any reason. The key name can be virtually any of the keys listed in the documentation, including mouse buttons (at least under WinXP, and they will probably work on other OSes as well).
Added a new optional parameter to MouseClick. If this last parameter is D the button will be held down until it is released by the user physically clicking it or via another action in the script. If this last parameter is U, the button will be released (even if it wasn't down before, an up-event will still be sent).
Added new hotkey definition symbol ~
(tilde) to indicate that this hotkey's native function shouldn't be suppressed (hidden from the system) when the hotkey fires. For example, in the below, the mouse button click will be sent to the active window when it normally wouldn't be:
~RButton::Sleep, 1
Note: Special hotkeys that are substitutes for alt-tab always ignore this setting.
Changed commands that click the mouse (MouseClick, LeftClick, etc.) so that the clicks themselves cannot trigger hotkey subroutines. This prevents potential infinite loop conditions if a script were to send mouse events that happen to be valid hotkeys.
Changed slightly how hotkeys that are combinations of keyboard and mouse work: Normally if the prefix key of that pair modifies any other key (even something that isn't a hotkey) its key-up action won't fire (if it has one). This has been changed so that mouse buttons are the exception. For example:
Numpad0 & Numpad1::MsgBox, test1 ; Numpad0 is now a prefix key that is handled by the keyboard hook. Numpad0::MsgBox, test2 ; Now Numpad0 is both a prefix AND a suffix (a suffix because it has its own action)
Under the old method, if Numpad0 was pressed down and then a mouse button clicked, the Numpad0 action would not fire when Numpad0 is released, as it normally would. Under the new method it does, but only if the combination of Numpad0 and that mouse button isn't a hotkey (since by default, the key/mouse events that comprise a hotkey are always hidden from the system unless the ~
symbol, described above, is used).
Added command Suspend. It's just like the tray menu item of the same name. The first parameter can be either blank (to toggle the state to the opposite setting), ON (to suspend hotkeys), or OFF (to resume). Note: Any hotkey whose subroutine's first line is the Suspend command will not be subject to suspension. This allows any such hotkey to turn off the suspension.
Improved Run and RunWait so that they attempt CreateProcess() (the AutoIt method) if the normal ShellExecute() method fails to work. This should make things more flexible and more like AutoIt. Note: Internally, the ShellExecute() method is always attempted first because I believe it has more capabilities, such as the ability to run documents, launch URLs, and execute system verbs such as "properties" (see below).
Run and RunWait now support the following system verbs: properties, edit, print, find, explore, open, and print. For example:
Run, properties c:\autoexec.bat ; Bring up the properties dialog for this file. Run, edit %A_SCRIPTFULLPATH% ; Perform the associated "edit" action for this file (if it has one).
Added #Delimiter command. This can be used to change the default (comma) delimiter, which is used to separate commands and parameters from each other. Note: It cannot be a space, tab (since some editors replace tabs with spaces), or a char that it already in use for another special purpose. For example:
#Delimiter . ; Make the delimiter a period rather than a comma.
Fixed tray menu item "Edit This Script" (again) because it still wasn't working right.
Enabled tray menu item "Suspend". This function prevents new hotkey subroutines from launching (but Alt-Tab hotkeys will still work). In other words, pressing a hotkey will have no effect at all; it won't even be seen by the system. For example, if Ctrl+C is a hotkey, it would do nothing rather than its normal "copy" behavior. Note: "Suspend" will not halt any subroutines that are already running.
FIXES:
Fixed the tray menu item "Edit This Script".
Fixed compatibility-check for AutoIt2: some of the default AutoIt2 behaviors weren't being used.
Fixed WinWait commands: ExcludeText and ExcludeTitle weren't being handled correctly.
Turned off debug logging: If you were running an older version, you may have a small text file "C:\AutoHotkey SetForegroundWindowEx.txt", which you can safely delete after upgrading to this version.
Changed StringReplace so that it doesn't trim whitespace from the result, which matches AutoIt2's behavior.
CHANGES:
Included the VC++ project in the source code ZIP file.
Changed the default for .aut (AutoIt2) scripts to DetectHiddenWindows, Off
, so that things are more like AutoIt2. This is now the default for all scripts. From what I can tell, unlike AutoIt2, AutoIt3 always detects hidden windows. Since this can sometimes cause problems with window matching and distinctness, the AutoIt2 method seems to be a better default.
Changed the SetTitleMatchMode command. In addition to supporting the traditional modes of 1 & 2, the command now supports the words Fast and Slow (e.g. SetTitleMatchMode, Slow
). The default is Fast, which is what AutoIt2 uses, whereas AutoIt3 uses the slow mode because it can "see" more text for certain windows. The fast mode performs significantly better, which may help the speed of scripts that do a lot of windowing commands. The slow mode can be used to ensure full compatibility with AutoIt3 and its Window Spy (the Spy is included with AutoHotkey). I'm thinking of modifying the Window Spy so that it indicates which text of a window is available only in the "slow" mode.
Window finding reliability: Made the "slow" TitleMatchMode more reliable by increasing the timeout to 5 seconds because some windows are sluggish about checking their message queues (e.g. during long disk operations), and thus very slow to cough up their window text.
In this version, by default, multiple instances of the same script can be launched. If you wish to limit a script to a single instance, use the #SingleInstance directive described below.
ADDITIONS:
DriveSpaceFree (gets the free space [in MB] for a drive). For example: DriveSpaceFree, OutputVar, C:\
SetAutoTrim, on/off
(defaults to on): When you assign a value to a variable, this controls whether whitespace is automatically trimmed from the left and right of the string. For this purpose, whitespace consists of spaces and tabs, but NOT newlines (carriage returns). Thus, I believe the "on" setting yields the same behavior as AutoIt2 in this regard.
StringGetPos now supports a new optional last parameter. If the parameter is the letter R, the search goes from the right to left, so the last occurrence is found rather than the first.
ControlSetText: Derived from AutoIt3's function of the same name. For example: ControlSetText, ControlName, Some new text, wintitle, wintext, exclude-title, exclude-text
Note that some or all of the last four parameters can be omitted. If all of them are omitted, the window found by the most recent IfWinExist, IfWinNotExist, or WinWait will be used. This behavior is the same for almost all of the other windowing commands too.
#AllowSameLineComments: To increase compatibility with AutoIt2, scripts that end in .aut are normally not permitted to have same-line comments (e.g. Run, notepad ; this is a comment
). Add the line #AllowSameLineComments to the top of your script to allow them.
#SingleInstance: Specifying this anywhere in a script will prevent new instances of that script from being launched once there is already one running. Instead, you will be prompted for whether to close the existing instance. Note: You do not need to use "on" or "off" with this command.
#CommentFlag: Allows you to change the comment-flag from the default of semicolon to a string of your choice. The string can be up to 15 characters long. For example: #CommentFlag // ; Change to C++ style.
#EscapeChar: The escape character is normally accent (`
) but this allows you to change it to AutoIt2's escape character (backslash) or some other char of your choice. Note that by default, scripts that end in .aut will use the backslash for their escape char.
#DerefChar: The deref char is normally %
(e.g. Sleep, %SleepTime%
). You can change it to some other character with this.
TIPS
The first comma can always be omitted for any command, e.g. MsgBox This is the text of the Msgbox (single-parameter mode)
.
You can use CapsLock as a new "modifier", similar to Win, without changing its native function (WinNT/2k/XP only, currently). For example:
CapsLock & A::run, notepad CapsLock & S::run, calc
Fixed StringMid: It was previously able to read beyond the length of the input variable.
Disabled the auto-restore-on-resume feature -- which restores the foreground window that a suspended thread was working with -- because it probably causes more trouble than it's worth.
Fixed scripts randomly hanging (sleeping indefinitely): caused by the thread's main timer having been killed when it shouldn't be.
Fixed WinWait-type commands that would behave unexpectedly if a new hotkey subroutine was launched while the command was waiting for the timeout to expire: the new subroutine was overwriting a buffer that was still needed by the old subroutine.
Fixed: tray menu behaving strangely if a modal dialog, such as MsgBox or InputBox, was on the screen.
Fixed the REPEAT command, which was causing an infinite loop if its first parameter was a dereferenced variable rather than a literal number.
Initial release.