Advertisement
Najeebsk

SEARCH-FILES-WILDCARD-PATTERN.ahk

Apr 9th, 2023 (edited)
1,453
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*   INFO
  2.    NAJEEB TOOLS SEARCH FILES WILDCARD PATTERN TO SUIT YOU
  3.    Written by: Najeeb Shah Khan (najeebshahkhan@gmail.com)
  4.    Last Modified: 4-6-2023
  5. */
  6. ;#warn
  7. #NoEnv
  8. #LTrim
  9. #SingleInstance, Force
  10. Process, Priority, , A
  11. SendMode, Input
  12. SetBatchLines, -1
  13. ;#NoTrayIcon
  14. SetKeyDelay 0    ; In case SendInput is not available
  15. SetTitleMatchMode RegEx
  16. SetWorkingDir %A_WorkingDir% ;%A_ScriptDir%  
  17. ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  18. FileCreateDir, %A_ScriptDir%\DATA
  19. FileInstall , SEARCH-FILES-WILDCARD-PATTERN.ahk, %A_ScriptDir%\DATA\SEARCH-FILES-WILDCARD-PATTERN.ahk, 1
  20. FileInstall , S12.she, %A_ScriptDir%\DATA\S12.she, 1
  21. FileInstall , SkinH_EL.dll, %A_ScriptDir%\DATA\SkinH_EL.dll, 1
  22. FileSetAttrib +HS, %A_ScriptDir%\DATA\SEARCH-FILES-WILDCARD-PATTERN.ahk, 2
  23. FileSetAttrib +HS, %A_ScriptDir%\DATA\S12.she, 2
  24. FileSetAttrib +HS, %A_ScriptDir%\DATA\SkinH_EL.dll, 2
  25. FileSetAttrib +HS, %A_ScriptDir%\DATA, 2
  26. ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  27. SkinForm(Apply, A_ScriptDir . "\DATA\SkinH_EL.dll", A_ScriptDir . "\DATA\S12.she")
  28. OnExit, GetOut
  29. CustomColor = FFFF99
  30. Gui, Color, %CustomColor%
  31. GUI, FONT, S16
  32. Gui, Add, Text,CRed x8 y10, Wildcard Pattern(D:\*VIDEOS* , D:\VIDEOS* , D:\VIDEOS\* , D:\VIDEOS\*.* , D:\VIDEOS\*.mp3)
  33. GUI, FONT, S12
  34. Gui, Add, Edit, x8 y44 w800 h30 vDir,
  35. Gui, Add, Button, x820 y43 Default gDirs, SEARCH
  36. Gui, Add, ListBox, x8 y80 vMyListBox gMyListBox w900 r28
  37. Gui, Add, Button, x8 y660 gOK, Run Select File
  38. Gui, Add, Button, x140 y660 gReload, Search Again
  39. Dirs:
  40. GuiControlGet, Dir
  41. Loop, %Dir%, 1, 1  ; Change this folder and wildcard pattern to suit your preferences.
  42. {
  43. GuiControl,, MyListBox, %A_LoopFileFullPath%
  44. }
  45. Gui, Show, w920 h700, NAJEEB TOOLS SEARCH FILES WILDCARD PATTERN
  46. Return
  47. Reload:
  48. Gui, Submit, NoHide
  49. Reload
  50. Return
  51. MyListBox:
  52. if A_GuiControlEvent <> DoubleClick
  53. return
  54. OK:
  55. GuiControlGet, MyListBox  ; Retrieve the ListBox's current selection.
  56. MsgBox, 4,, Would you you like to launch the file or document below?`n`n%MyListBox%
  57. IfMsgBox, No
  58. return
  59. ; Otherwise, try to launch it:
  60. Run, %MyListBox%,, UseErrorLevel
  61. if ErrorLevel = ERROR
  62. MsgBox Could not launch the specified file.  Perhaps it is not associated with anything.
  63. return
  64. ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  65. GetOut:
  66. GuiClose:
  67. Gui, Hide
  68. SkinForm(0)
  69. ExitApp
  70. return
  71.  
  72. SkinForm(Param1 = "Apply", DLL = "", SkinName = ""){
  73.     if(Param1 = Apply){
  74.         DllCall("LoadLibrary", str, DLL)
  75.         DllCall(DLL . "\SkinH_AttachEx", AStr,SkinName, Str,"mhgd")
  76.     }else if(Param1 = 0){
  77.         DllCall(DLL . "\USkinExit")
  78.         }
  79. }
  80. ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  81. ;#R::Reload  ;<--  ~ Reload Script ~
  82. #S::Suspend ;<--  ~ Suspend Script ~
  83. #P::Pause   ;<--  ~ Pause Script ~
  84. #M::WinMinimize, ;<--  ~ Minimize Script ~
  85. ESC::ExitApp     ;<--  ~ Exit Script ~
  86. ;=-=-=-=-=-=-=-=-=-=- END SCRIPT -=-=-=-=-=-=-=-=-=-=-=-
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement