The script posted above works with AHK v1.1.16.04 as such (no modifications needed).
To insert it in the autocorrect script I broke it into GUI initialization, hotkey code and GUI - subroutines. The autocorrect script is posted below, but note that I had to trim the code as it is too big to post it and I can't upload a file. The full script can be found at http://www.autohotke...AutoCorrect.ahk .
;------------------------------------------------------------------------------
; CHANGELOG:
;
; Sep 13 2007: Added more misspellings.
; Added fix for -ign -> -ing that ignores words like "sign".
; Added word beginnings/endings sections to cover more options.
; Added auto-accents section for words like fiancée, naïve, etc.
; Feb 28 2007: Added other common misspellings based on MS Word AutoCorrect.
; Added optional auto-correction of 2 consecutive capital letters.
; Sep 24 2006: Initial release by Jim Biancolo (http://www.biancolo.com)
;
; INTRODUCTION
;
; This is an AutoHotKey script that implements AutoCorrect against several
; "Lists of common misspellings":
;
; This does not replace a proper spellchecker such as in Firefox, Word, etc.
; It is usually better to have uncertain typos highlighted by a spellchecker
; than to "correct" them incorrectly so that they are no longer even caught by
; a spellchecker: it is not the job of an autocorrector to correct *all*
; misspellings, but only those which are very obviously incorrect.
;
; From a suggestion by Tara Gibb, you can add your own corrections to any
; highlighted word by hitting Win+H. These will be added to a separate file,
; so that you can safely update this file without overwriting your changes.
;
; Some entries have more than one possible resolution (achive->achieve/archive)
; or are clearly a matter of deliberate personal writing style (wanna, colour)
;
; These have been placed at the end of this file and commented out, so you can
; easily edit and add them back in as you like, tailored to your preferences.
;
; SOURCES
;
; http://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings
; http://en.wikipedia.org/wiki/Wikipedia:Typo
; Microsoft Office autocorrect list
; Script by jaco0646 http://www.autohotkey.com/forum/topic8057.html
; OpenOffice autocorrect list
; TextTrust press release
; User suggestions.
;
; CONTENTS
;
; Settings
; AUto-COrrect TWo COnsecutive CApitals (commented out by default)
; Win+H code
; Fix for -ign instead of -ing
; Word endings
; Word beginnings
; Accented English words
; Common Misspellings - the main list
; Ambiguous entries - commented out
;------------------------------------------------------------------------------
;------------------------------------------------------------------------------
; Settings
;------------------------------------------------------------------------------
#NoEnv ; For security
#SingleInstance force
;------------------------------------------------------------------------------
; INITIALIZATION - GUI
;------------------------------------------------------------------------------
; a tiny GUI setup
Gui, Add, Text, x20 y50 w10 h20 +Center, :
Gui, Add, Edit, vopt x30 y50 w40 h20 +Center,
Gui, Add, Text, x70 y50 w10 h20 +Center, :
Gui, Add, Edit, vfrom x90 y50 w300 h20,
Gui, Add, Text, x400 y50 w10 h20 +Center, ::
Gui, Add, Edit, vto x420 y50 w300 h20,
Gui, Add, Button, x270 y100 w80 h30 Default, OK
Gui, Add, Button, x390 y100 w80 h30, Cancel
;------------------------------------------------------------------------------
; AUto-COrrect TWo COnsecutive CApitals.
; Disabled by default to prevent unwanted corrections such as IfEqual->Ifequal.
; To enable it, remove the /*..*/ symbols around it.
; From Laszlo's script at http://www.autohotkey.com/forum/topic9689.html
;------------------------------------------------------------------------------
/*
; The first line of code below is the set of letters, digits, and/or symbols
; that are eligible for this type of correction. Customize if you wish:
keys = abcdefghijklmnopqrstuvwxyz
Loop Parse, keys
HotKey ~+%A_LoopField%, Hoty
Hoty:
CapCount := SubStr(A_PriorHotKey,2,1)="+" && A_TimeSincePriorHotkey<999 ? CapCount+1 : 1
if CapCount = 2
SendInput % "{BS}" . SubStr(A_ThisHotKey,3,1)
else if CapCount = 3
SendInput % "{Left}{BS}+" . SubStr(A_PriorHotKey,3,1) . "{Right}"
Return
*/
;------------------------------------------------------------------------------
; Win+H to enter misspelling correction. It will be added to this script.
;------------------------------------------------------------------------------
#h::
; Get the selected text. The clipboard is used instead of "ControlGet Selected" as it works in
;more editors and word processors, java apps, etc. Save the current clipboard contents to be restored later.
AutoTrim Off ; Retain any leading and trailing whitespace on the clipboard.
ClipboardOld = %ClipboardAll%
Clipboard = ; Must start off blank for detection to work.
Send ^c
ClipWait 1
if ErrorLevel ; ClipWait timed out.
return
; Replace CRLF and/or LF with `n for use in a "send-raw" hotstring: The same is done for any other characters that might otherwise be a problem in raw mode:
StringReplace, Hotstring, Clipboard, ``, ````, All ; Do this replacement first to avoid interfering with the others below.
StringReplace, Hotstring, Hotstring, `r`n, ``r, All ; Using `r works better than `n in MS Word, etc.
StringReplace, Hotstring, Hotstring, `n, ``r, All
StringReplace, Hotstring, Hotstring, %A_Tab%, ``t, All
StringReplace, Hotstring, Hotstring, `;, ```;, All
; trim the word (better imo)
Hotstring := Trim(Hotstring)
Clipboard = %ClipboardOld% ; Restore previous contents of clipboard.
; setting the hotstrings in the GUI
GuiControl,, to, %Hotstring%
GuiControl,, from, %Hotstring%
; focus to the "to" gui
GuiControl, Focus, to
Gui, Show,, Add a correction or shortcut
; send control + a in order to selecct the text in the "to" gui (better imo)
Send, ^a
return
#Hotstring R ; Set the default to be "raw mode" (might not actually be relied upon by anything yet).
;------------------------------------------------------------------------------
; Fix for -ign instead of -ing.
; Words to exclude: (could probably do this by return without rewrite)
; From: http://www.morewords.com/e nds-with/gn/
;------------------------------------------------------------------------------
#Hotstring B0 ; Turns off automatic backspacing for the following hotstrings.
::align::
::antiforeign::
::arraign::
::assign::
;
;TRIMMED CODE
;
::august::August
::september::September
::october::October
::november::November
::december::December
;-------------------------------------------------------------------------------
; GUI subroutines
;-------------------------------------------------------------------------------
; happens when pressing the OK button
ButtonOK:
; assembling the hotstring and save it to this file
GuiControlGet, opt
GuiControlGet, to
GuiControlGet, from
Hotstring := ":" opt ":" from "::" to
FileAppend, `n%Hotstring%, %A_ScriptFullPath%
Gui, Show, Hide
Send %to% ;replace the initial word with the corrected one
Reload
Sleep 200 ; If successful, the reload will close this instance during the Sleep, so the line below willyt never be reached.
MsgBox, 4,, The hotstring just added appears to be improperly formatted. Would you like to open the script for editing? Note that the bad hotstring is at the bottom of the script.
IfMsgBox, Yes, Edit
return
GuiEscape:
GuiClose:
ButtonCancel:
Gui, Show, Hide
return
;-------------------------------------------------------------------------------
; Anything below this point was added to the script by the user via the Win+H hotkey.
;-------------------------------------------------------------------------------