自动热键搜索部分匹配

autohotkey search for a partial match

有人可以帮我搜索部分匹配的代码吗?我似乎被困在这里了。

我只想在组合框中键入前几个字母,按回车键,然后将我键入的任何内容存储为变量。然后我想根据我的列表检查我的变量,以获得与我输入的内容最接近的名称。这成为新的变量。我该怎么做?

#singleInstance, Force

list =
(
Phone Numbers
Important People
Modification
Traffic Data
Tasks
Tracker
)
Gui, +alwaysontop
Gui +Delimiter`n
Gui, Add, ComboBox, vMyVar w200 h110 CHOOSE1 sort, % LIST
Gui, Add, Button, gGO Default x+5 w60 h20 , GO
Gui, show, y200, What do you want now?!
return

; Type first couple letters in box hit enter

GO:
Gui, Submit, nohide
Loop, parse, List, `n
{
; Search LIST for nearest match
;First partial match found
; MyVar := "A_loopfield"
MsgBox % InStr(A_loopfield, DoThis)
}

if MyVar = Phone Numbers
; Msgbox or Function ETC..

尝试

#singleInstance, Force

list =
(
Phone Numbers
Important People
Modification
Traffic Data
Tasks
Tracker
)
Gui, +alwaysontop
Gui +Delimiter`n
Gui, Add, ComboBox, vMyVar w200 h110 CHOOSE1 sort, % LIST
Gui, Add, Button, gGO Default x+5 w60 h20 , GO
Gui, show, y200, What do you want now?!
return

; Type first couple letters in box hit enter

GO:
Gui, Submit, nohide
GuiControlGet, text_typed,, ComboBox1
StringLen, length, text_typed ; retrieves the count of how many characters are  in the text typed
Loop, parse, List, `n
{
    If (SubStr(A_LoopField, 1, length) = text_typed)
    {
        GuiControl, Choose, MyVar, %A_LoopField%
        If (A_LoopField = "Phone Numbers")
            MsgBox, Item 1
        ; ...
        If (A_LoopField = "Traffic Data")
            MsgBox, Item 6
                break   
    }
}
return