Here's an auto-complete AutoHotkey v2 Class.
Up to 20 completion suggestions will be shown as user inputs partial file/folder paths.
Tab key cycles through suggestions (will be highlighted/selected)
Shift+Tab cycles in the opposite direction
Enter key accepts suggestions (unhighlights/deselects this suggestion). If nothing is highlighted, Enter will submit the result and close the GUI.
< (less than) character enables folder only mode
> (greater than) character enables file only mode
" (double quote) charater indicates provided file/folder path pattern is literal and * (asterisk) will not be appended automatically
Escape key closes the GUI without submitting any path.
* and ? wildcards are supported
Folders will have brackets around them. ie: [Windows]
The overall result is similiar to Windows' Run command but with support of wildcards (?/*) and without the need to use mouse/arrow keys to select suggestions.
Example usage:
Code: Select all
a := new classAutoPath(A_WinDir, "w500")
while true {
if a.ready || a.error
break
sleep 100
}
if a.error
MsgBox("error")
if a.ready
Run(a.path)
This creates an classAutoPath object with the default folder set to A_WinDir and a GUI width of 500.
Properties:
.ready is set to 1 once user has submitted a file/folder path (invalid paths are not checked). Default is 0.
.error is set to 1 if user exits GUI prior to submission (0 otherwise)
.path is the submitted path as string
Code is posted at https://github.com/oif2003/AHK_v2_64bit ... toPath.ahk