Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- folderpath = %A_desktop%
- f1::
- guilist=
- Loop, %folderpath%\*.* , 2
- {
- StringReplace, cleanname, A_LoopFileFullPath, %folderpath%\, , All
- guilist .=cleanname "|"
- }
- StringTrimRight guilist, guilist, 1
- gui, destroy
- Gui, Add, Edit, x12 y9 w200 h20 gsearchchange vSearch,
- Gui, Add, Button, x12 y339 w100 h30 gopenfolder, Open
- Gui, Add, Button, x112 y339 w100 h30 gguiclose, Close
- Gui, Add, ListBox, x12 y39 w200 h300 vcommandlookup gMyListBox, %sites%
- GuiControl,, commandlookup, %guilist%
- Gui, Show, x810 y458 h379 w229, Folder List
- Return
- MyListBox:
- if A_GuiControlEvent <> DoubleClick
- return
- ; Otherwise, the user double-clicked a list item.
- GuiControlGet, commandlookup ; Retrieve the ListBox's current selection.
- run %folderpath%\%commandlookup%
- return
- openfolder:
- gui, submit, nohide
- run %folderpath%\%commandlookup%
- Return
- guiclose:
- gui, submit
- Return
- ;==================================================
- ;search updater
- ;==================================================
- ; on edit change
- searchchange:
- Gui,Submit,NoHide
- if !(InStr(Search, commandlookup, false)) {
- #Persistent
- GuiControl, , commandlookup
- return
- }
- sitesArr := StrSplit(sites, "|")
- newArr := []
- newStr := ""
- for k,v in sitesArr
- {
- if InStr(v, Search, false)>0
- {
- newArr.push(v)
- }
- }
- for k,v in newArr
- newStr .= "|" v
- GuiControl, , commandlookup, % newStr
- GuiControl, Choose, commandlookup, 1
- Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement