Here's the full script (I had it in my previous post too, just without the fix for the cursor moving vertically... why didn't you use that?)... The reason it didn't work for your wordlist is that you were using the original version from the first post. The version I made can handle your 1.3 MB (!!) wordlist. My modifications take the time to run this from 20+% cpu down to 2% on my X2 4200+ even with your wordlist, and the words pop up right away.
2 press version:
Code:
; Intellitype: typing aid
; Press 1 to 0 keys to autocomplete the word upon suggestion
; (0 will match suggestion 10)
; - Jordi S
; Heavily modified by:
; Maniac
;___________________________________________
; CONFIGURATIONS
; Editor Window Recognition
; (make it blank to make the script seek all windows)
ETitle =
;Minimum word length to make a guess
WLen = 3
keyagain=
key=
clearword=1
;Gosub,clearallvars ; clean vars from start
; Press 1 to 0 keys to autocomplete the word upon suggestion
; (0 will match suggestion 10)
;_______________________________________
CoordMode, ToolTip, Relative
AutoTrim, Off
;reads list of words from file
Loop, Read, %A_ScriptDir%\Wordlist.txt
{
StringLeft, Base, a_loopreadline, %wlen%
Base := ConvertWordToAscii(Base)
basenum%Base%++
pos := basenum%Base%
cmd%Base%%pos% = %a_loopreadline%
}
SetTimer, Winchanged, 100
Loop
{
;Editor window check
WinGetActiveTitle, ATitle
WinGet, A_id, ID, %ATitle%
IfNotInString, ATitle, %ETitle%
{
ToolTip
Setenv, Word,
sleep, 500
Continue
}
;Get one key at a time
Input, chr, L1 V,{enter}{space}.;`,:¿?¡!'"()]{}{}}{bs}{{}{esc}{tab}{Home}{End}{PgUp}{PdDn}{Up}{Dn}{Left}{Right}
EndKey = %errorlevel%
; If active window has different window ID from before the input, blank word
; (well, assign the number pressed to the word)
WinGetActiveTitle, ATitle
WinGet, A_id2, ID, %ATitle%
IfNotEqual, A_id, %A_id2%
{
Gosub,clearallvars
Setenv, Word, %chr%
Continue
}
ifequal, OldCaretY,
OldCaretY = %A_CaretY%
ifnotequal, OldCaretY, %A_CaretY%
{
Gosub,clearallvars
Setenv, Word, %chr%
Continue
}
OldCaretY=%A_CaretY%
;Backspace clears last letter
ifequal, EndKey, Endkey:BackSpace
{
StringLen, len, Word
IfNotEqual, len, 0
{ ifequal, len, 1
{
Gosub,clearallvars
} else {
StringTrimRight, Word, Word, 1
}
}
} else ifequal, EndKey, Max
{
ifequal, chr, @
{
Gosub,clearallvars
Setenv, Word, %chr%
Continue
} else {
Setenv, Word, %word%%chr%
}
} else Gosub,clearallvars
;Wait till minimum letters
StringLen, len, Word
IfLess, len, %wlen%
{
ToolTip
Continue
}
;Match part-word with command
Num =
Match =
singlematch = 0
number = 0
StringLeft, baseword, Word, %wlen%
baseword := ConvertWordToAscii(baseword)
Loop
{
IfEqual, cmd%baseword%%a_index%,, Break
IfEqual, number, 10
Break
StringLen, chars, Word
StringLeft, strippedcmd, cmd%baseword%%a_index%, %chars%
ifequal, strippedcmd, %Word%
{
number ++
singlematch := cmd%baseword%%a_index%
match = %match%%number%. %singlematch%`n
singlematch%number% = %singlematch%
Continue
}
}
;If no match then clear Tip
IfEqual, Match,
{
clearword=0
Gosub,clearallvars
Continue
}
;Show matched command
StringTrimRight, match, match, 1 ; Get rid of the last linefeed
WinGetActiveTitle, ATitle
WinGetPos, , PosY, , SizeY, %ATitle%
MaxY := PosY + SizeY
ToolTipSizeY := (number * 12)
ToolTipPosY := A_CaretY+14
if ((ToolTipSizeY + ToolTipPosY) > MaxY)
ToolTipPosY := (A_CaretY - 14 - ToolTipSizeY)
IfNotEqual, Word,,ToolTip, %match%, %A_CaretX%, %ToolTipPosY%
; +14 Move tooltip down a little so as not to hide the caret.
}
; Timed function to detect change of focus (and remove tooltip when changing active window)
Winchanged:
WinGetActiveTitle, ATitle
WinGet, A_id3, ID, %ATitle%
IfNotEqual, A_id, %A_id3%
{
ToolTip ,
} else {
; If we are in the correct window, and OldCaretY is set, clear the tooltip if not in the same line
IfInString, ATitle, %ETitle%
{
IfNotEqual, OldCaretY,
{
IfNotEqual, OldCaretY, %A_CaretY%
{
ToolTip,
}
}
}
}
Return
; Key definitions for autocomplete (0 to 9)
#MaxThreadsPerHotkey 1
$1::
key=1
Gosub, checkword
Return
$2::
key=2
Gosub, checkword
Return
$3::
key=3
Gosub, checkword
Return
$4::
key=4
Gosub, checkword
Return
$5::
key=5
Gosub, checkword
Return
$6::
key=6
Gosub, checkword
Return
$7::
key=7
Gosub, checkword
Return
$8::
key=8
Gosub, checkword
Return
$9::
key=9
Gosub, checkword
Return
$0::
key=10
Gosub, checkword
Return
; If hotkey was pressed, check wether there's a match going on and send it, otherwise send the number(s) typed
checkword:
clearword=1
Suspend, on ; Suspend hotkeys so that they don't interfere with the second press
; If active window has different window ID from before the input, blank word
; (well, assign the number pressed to the word)
WinGetActiveTitle, ATitle
WinGet, A_id2, ID, %ATitle%
IfNotEqual, A_id, %A_id2%
{
if key =10
key = 0
SendInput,%key%
Gosub,clearallvars
Suspend, off
Return
}
IfNotEqual, OldCaretY, %A_CaretY%
{
if key =10
key = 0
SendInput,%key%
Gosub,clearallvars
Suspend, off
Return
}
if word= ; only continue if word is not empty
{
if key =10
key = 0
SendInput,%key%
Setenv, Word, %key%
clearword=0
Gosub,clearallvars
Suspend, off
Return
}
ifequal, singlematch%key%, ; only continue singlematch is not empty
{
if key =10
key = 0
SendInput,%key%
Setenv, Word, %word%%key%
clearword=0
Gosub,clearallvars
Suspend, off
Return
}
; 2nd press to confirm replacement
Input, keyagain, L1 I T0.5, 1234567890
; msgbox, ErrorLevel=%ErrorLevel% ; UNCOMMENT FOR TESTING 2ND PROBLEM DISCUSSED IN POST
; If there is a timeout, abort replacement, send key and return
IfEqual, ErrorLevel, Timeout
{
if key =10
key = 0
SendInput, %key%
Setenv, Word, %word%%key%
clearword=0
Gosub,clearallvars
Suspend, off
Return
}
; Make sure it's an EndKey, otherwise abort replacement, send key and return
IfNotInString, ErrorLevel, EndKey:
{
if key =10
key = 0
SendInput, %key%%keyagain%
Setenv, Word, %word%%key%%keyagain%
clearword=0
Gosub,clearallvars
Suspend, off
Return
}
; If the 2nd key is NOT the same 1st trigger key, abort replacement and send keys
if key =10
key = 0
IfNotInString,ErrorLevel, %key%
{
StringTrimLeft, keyagain, ErrorLevel, 7
SendInput, %key%%keyagain%
Setenv, Word, %word%%key%%keyagain%
clearword=0
Gosub,clearallvars
Suspend, off
Return
}
; SEND THE WORD!
if key =0
key = 10
sending := singlematch%key%
StringLen, len, Word
SendInput, {BS %len%}{Raw}%sending% ; First do the backspaces, Then send word (Raw because we want the string exactly as in wordlist.txt)
Gosub,clearallvars
Suspend, off
Return
; This is to blank all vars related to matches, tooltip and (optionally) word
clearallvars:
Ifequal,clearword,1,Setenv,word,
ToolTip
; Clear all singlematches
Loop, 10
{
singlematch%a_index% =
}
sending =
key=
match=
clearword=1
OldCaretY=
Return
ConvertWordToAscii(Base)
{
StringUpper, Base, Base
StringLen, Len, Base
Loop, %Len%
{
Transform, Letter, Asc, %Base%
StringLen, LetterLen, Letter
IfLess, %LetterLen%, 3
{
Amt := 3-LetterLen
Loop, %Amt%
{
Letter = 0%Letter%
}
}
New = %New%%Letter%
StringTrimLeft, Base, Base, 1
}
Return New
}
1 press version:
Code:
; Intellitype: typing aid
; Press 1 to 0 keys to autocomplete the word upon suggestion
; (0 will match suggestion 10)
; - Jordi S
; Heavily modified by:
; Maniac
;___________________________________________
; CONFIGURATIONS
; Editor Window Recognition
; (make it blank to make the script seek all windows)
ETitle =
;Minimum word length to make a guess
WLen = 3
keyagain=
key=
clearword=1
;Gosub,clearallvars ; clean vars from start
; Press 1 to 0 keys to autocomplete the word upon suggestion
; (0 will match suggestion 10)
;_______________________________________
CoordMode, ToolTip, Relative
AutoTrim, Off
;reads list of words from file
Loop, Read, %A_ScriptDir%\Wordlist.txt
{
StringLeft, Base, a_loopreadline, %wlen%
Base := ConvertWordToAscii(Base)
basenum%Base%++
pos := basenum%Base%
cmd%Base%%pos% = %a_loopreadline%
}
SetTimer, Winchanged, 100
Loop
{
;Editor window check
WinGetActiveTitle, ATitle
WinGet, A_id, ID, %ATitle%
IfNotInString, ATitle, %ETitle%
{
ToolTip
Setenv, Word,
sleep, 500
Continue
}
;Get one key at a time
Input, chr, L1 V,{enter}{space}.;`,:¿?¡!'"()]{}{}}{bs}{{}{esc}{tab}{Home}{End}{PgUp}{PdDn}{Up}{Dn}{Left}{Right}
EndKey = %errorlevel%
; If active window has different window ID from before the input, blank word
; (well, assign the number pressed to the word)
WinGetActiveTitle, ATitle
WinGet, A_id2, ID, %ATitle%
IfNotEqual, A_id, %A_id2%
{
Gosub,clearallvars
Setenv, Word, %chr%
Continue
}
ifequal, OldCaretY,
OldCaretY = %A_CaretY%
ifnotequal, OldCaretY, %A_CaretY%
{
Gosub,clearallvars
Setenv, Word, %chr%
Continue
}
OldCaretY=%A_CaretY%
;Backspace clears last letter
ifequal, EndKey, Endkey:BackSpace
{
StringLen, len, Word
IfNotEqual, len, 0
{ ifequal, len, 1
{
Gosub,clearallvars
} else {
StringTrimRight, Word, Word, 1
}
}
} else ifequal, EndKey, Max
{
ifequal, chr, @
{
Gosub,clearallvars
Setenv, Word, %chr%
Continue
} else {
Setenv, Word, %word%%chr%
}
} else Gosub,clearallvars
;Wait till minimum letters
StringLen, len, Word
IfLess, len, %wlen%
{
ToolTip
Continue
}
;Match part-word with command
Num =
Match =
singlematch = 0
number = 0
StringLeft, baseword, Word, %wlen%
baseword := ConvertWordToAscii(baseword)
Loop
{
IfEqual, cmd%baseword%%a_index%,, Break
IfEqual, number, 10
Break
StringLen, chars, Word
StringLeft, strippedcmd, cmd%baseword%%a_index%, %chars%
ifequal, strippedcmd, %Word%
{
number ++
singlematch := cmd%baseword%%a_index%
match = %match%%number%. %singlematch%`n
singlematch%number% = %singlematch%
Continue
}
}
;If no match then clear Tip
IfEqual, Match,
{
clearword=0
Gosub,clearallvars
Continue
}
;Show matched command
StringTrimRight, match, match, 1 ; Get rid of the last linefeed
WinGetActiveTitle, ATitle
WinGetPos, , PosY, , SizeY, %ATitle%
MaxY := PosY + SizeY
ToolTipSizeY := (number * 12)
ToolTipPosY := A_CaretY+14
if ((ToolTipSizeY + ToolTipPosY) > MaxY)
ToolTipPosY := (A_CaretY - 14 - ToolTipSizeY)
IfNotEqual, Word,,ToolTip, %match%, %A_CaretX%, %ToolTipPosY%
; +14 Move tooltip down a little so as not to hide the caret.
}
; Timed function to detect change of focus (and remove tooltip when changing active window)
Winchanged:
WinGetActiveTitle, ATitle
WinGet, A_id3, ID, %ATitle%
IfNotEqual, A_id, %A_id3%
{
ToolTip ,
} else {
; If we are in the correct window, and OldCaretY is set, clear the tooltip if not in the same line
IfInString, ATitle, %ETitle%
{
IfNotEqual, OldCaretY,
{
IfNotEqual, OldCaretY, %A_CaretY%
{
ToolTip,
}
}
}
}
Return
; Key definitions for autocomplete (0 to 9)
#MaxThreadsPerHotkey 1
$1::
key=1
Gosub, checkword
Return
$2::
key=2
Gosub, checkword
Return
$3::
key=3
Gosub, checkword
Return
$4::
key=4
Gosub, checkword
Return
$5::
key=5
Gosub, checkword
Return
$6::
key=6
Gosub, checkword
Return
$7::
key=7
Gosub, checkword
Return
$8::
key=8
Gosub, checkword
Return
$9::
key=9
Gosub, checkword
Return
$0::
key=10
Gosub, checkword
Return
; If hotkey was pressed, check wether there's a match going on and send it, otherwise send the number(s) typed
checkword:
clearword=1
; If active window has different window ID from before the input, blank word
; (well, assign the number pressed to the word)
WinGetActiveTitle, ATitle
WinGet, A_id2, ID, %ATitle%
IfNotEqual, A_id, %A_id2%
{
if key =10
key = 0
SendInput,%key%
Gosub,clearallvars
Return
}
IfNotEqual, OldCaretY, %A_CaretY%
{
if key =10
key = 0
SendInput,%key%
Gosub,clearallvars
Return
}
if word= ; only continue if word is not empty
{
if key =10
key = 0
SendInput,%key%
Setenv, Word, %key%
clearword=0
Gosub,clearallvars
Return
}
ifequal, singlematch%key%, ; only continue singlematch is not empty
{
if key =10
key = 0
SendInput,%key%
Setenv, Word, %word%%key%
clearword=0
Gosub,clearallvars
Return
}
; SEND THE WORD!
if key =0
key = 10
sending := singlematch%key%
StringLen, len, Word
SendInput, {BS %len%}{Raw}%sending% ; First do the backspaces, Then send word (Raw because we want the string exactly as in wordlist.txt)
Gosub,clearallvars
Return
; This is to blank all vars related to matches, tooltip and (optionally) word
clearallvars:
Ifequal,clearword,1,Setenv,word,
ToolTip
; Clear all singlematches
Loop, 10
{
singlematch%a_index% =
}
sending =
key=
match=
clearword=1
OldCaretY=
Return
ConvertWordToAscii(Base)
{
StringUpper, Base, Base
StringLen, Len, Base
Loop, %Len%
{
Transform, Letter, Asc, %Base%
StringLen, LetterLen, Letter
IfLess, %LetterLen%, 3
{
Amt := 3-LetterLen
Loop, %Amt%
{
Letter = 0%Letter%
}
}
New = %New%%Letter%
StringTrimLeft, Base, Base, 1
}
Return New
}
But um, 109,538 words is a little overkill isn't it? That's about 1/5th of the words in the english language, lol. My wordlist, for example, is ~1,400 words. Most of the time you'd use an autoreplacer like this for commonly typed words, not the entire dictionary

.