Advertisement
tabnation

folder puller v2

Jul 15th, 2022
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1.  
  2. folderpath = %A_desktop%
  3.  
  4. f1::
  5. guilist=
  6. Loop, %folderpath%\*.* , 2
  7. {
  8. StringReplace, cleanname, A_LoopFileFullPath, %folderpath%\, , All
  9. guilist .=cleanname "|"
  10. }
  11. StringTrimRight guilist, guilist, 1
  12.  
  13. gui, destroy
  14. Gui, Add, Edit, x12 y9 w200 h20 gsearchchange vSearch,
  15. Gui, Add, Button, x12 y339 w100 h30 gopenfolder, Open
  16. Gui, Add, Button, x112 y339 w100 h30 gguiclose, Close
  17. Gui, Add, ListBox, x12 y39 w200 h300 vcommandlookup gMyListBox, %sites%
  18. GuiControl,, commandlookup, %guilist%
  19. Gui, Show, x810 y458 h379 w229, Folder List
  20. Return
  21.  
  22. MyListBox:
  23. if A_GuiControlEvent <> DoubleClick
  24. return
  25. ; Otherwise, the user double-clicked a list item.
  26. GuiControlGet, commandlookup ; Retrieve the ListBox's current selection.
  27. run %folderpath%\%commandlookup%
  28. return
  29.  
  30. openfolder:
  31. gui, submit, nohide
  32. run %folderpath%\%commandlookup%
  33. Return
  34.  
  35. guiclose:
  36. gui, submit
  37. Return
  38.  
  39. ;==================================================
  40. ;search updater
  41. ;==================================================
  42. ; on edit change
  43. searchchange:
  44. Gui,Submit,NoHide
  45.  
  46. if !(InStr(Search, commandlookup, false)) {
  47. #Persistent
  48. GuiControl, , commandlookup
  49. return
  50. }
  51. sitesArr := StrSplit(sites, "|")
  52. newArr := []
  53. newStr := ""
  54. for k,v in sitesArr
  55. {
  56. if InStr(v, Search, false)>0
  57. {
  58. newArr.push(v)
  59. }
  60. }
  61. for k,v in newArr
  62. newStr .= "|" v
  63. GuiControl, , commandlookup, % newStr
  64. GuiControl, Choose, commandlookup, 1
  65. Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement