Advertisement
Najeebsk

FILE-SEARCH.ahk

Dec 11th, 2023
1,832
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; <COMPILER: v1.1.34.04>
  2. #NoEnv
  3. #SingleInstance, Force
  4. SetBatchLines, -1
  5. ;#NoTrayIcon
  6. SetWorkingDir %A_ScriptDir%  
  7. ;----------------------------------------------------
  8. FileEncoding, UTF-8
  9. vlcx        =%A_programfiles%\VideoLAN\VLC\vlc.exe
  10. vlcx2        =%A_windir%\notepad.exe
  11. vlcx3        =D:\TOOLS\HONEYVIEW-PORTABLE\Honeyview.exe
  12. vlcx4        =%A_windir%\explorer.exe
  13. vlcx5        =%A_programfiles%\WinRAR\WinRAR.exe
  14. vlcx6        =%A_windir%\explorer.exe
  15. HK1=Esc                       ;- ESC toggle sound
  16.   Hotkey,%hk1%,pause1,ON
  17. t:=""
  18. Filename1=NAJEEB SHAH KHAN SEARCH FILES AND RUN  ( esc= sound ON/OFF )
  19. ;---------------------------------------------
  20. ;all1     :="mp3,aac,flac,aif,aiff,m4a,mp4,flv,mpg,vob,mvk,wmv,avi,m3u,m3u8,xml,jpg,jpge,bmp,png,gif,ico,txt,bat,vbs,ahk,au3,sh,ini,ls,doc,cmd,js,pdf,fm,exe,ink,cpl,dll,rar,zip,7z,iso,daa,bin,cue,img"
  21. music1    :="mp3,aac,flac,aif,aiff,m4a"
  22. video1    :="mp4,flv,mpg,vob,mvk,wmv,avi"
  23. channel1   :="m3u,m3u8,xml"
  24. picture1   :="jpg,jpge,bmp,png,gif,ico"
  25. text1   :="txt,bat,vbs,ahk,au3,sh,ini,ls,doc,cmd,js,pdf,fm"
  26. exe1   :="exe,ink"
  27. sys1   :="cpl"
  28. zip1   :="rar,zip,7z,iso,daa,bin,cue,img"
  29. ;------------------------------------------------
  30. Gui,default
  31. Gui,Color, ControlColor, Black
  32. Gui,Font, CBlack s14, Lucida Console
  33. ;-------------------------------------------------
  34. Gui, Add, DropDownList, x10 y5 w160 h25 vDrive gFD1, Select Drive||C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z
  35. Gui, Add, Button,x180 y5 w160 h25 gFolder  , Select-Folder
  36. Gui,Font, CWhite s14, Lucida Console
  37. Gui, Add, Edit,x350 y5 w260 h25 vSEC  , Type Search Ext
  38. Gui,Font, CBlack s14, Lucida Console
  39. Gui, Add, Button,x620 y5 w160 h25 gEXT, SEARCH
  40. Gui,Add, Button,x830    y5  w100 h25 gREF   ,REFRESH
  41. Gui, Add, ListView, x10 y40 h425 w920 gMLV vF1 altsubmit grid backgroundgray, Name|Fullpath
  42. LV_ModifyCol(1,890)
  43. LV_ModifyCol(2,0)
  44.  
  45. GUI,show, NA W940 H550 X20 Y0,%filename1%
  46. return
  47. ;-------------------------------------
  48. MLV:
  49. if A_GuiEvent = Normal
  50.   {
  51.   LV_GetText(C2,A_EventInfo,2)
  52.   SplitPath,C2, name, dir, ext, name_no_ext, drive
  53.   if ext in %music1%
  54.       {
  55.       Process, Exist, vlc.exe
  56.       If ErrorLevel
  57.         Process,close,vlc.exe
  58.       Soundplay, %C2%
  59.       }
  60.   else
  61.      {
  62.  if ext in %text1%
  63.       {
  64.       Process, Exist, vlc.exe
  65.       If ErrorLevel
  66.         Process,close,vlc.exe
  67.       run, %C2% %vlcx2%
  68.       }
  69. else
  70.      {
  71.  if ext in %picture1%
  72.       {
  73.       Process, Exist, vlc.exe
  74.       If ErrorLevel
  75.         Process,close,vlc.exe
  76.       run, %C2% %vlcx3%
  77.       }
  78. else
  79.      {
  80.  if ext in %exe1%
  81.       {
  82.       Process, Exist, vlc.exe
  83.       If ErrorLevel
  84.         Process,close,vlc.exe
  85.       run, %C2% %vlcx4%
  86.       }
  87. else
  88.      {
  89.  if ext in %zip1%
  90.       {
  91.       Process, Exist, vlc.exe
  92.       If ErrorLevel
  93.         Process,close,vlc.exe
  94.       run, %C2% %vlcx5%
  95.       }
  96. else
  97.      {
  98.  if ext in %sys1%
  99.       {
  100.       Process, Exist, vlc.exe
  101.       If ErrorLevel
  102.         Process,close,vlc.exe
  103.       run, %C2% %vlcx6%
  104.       }
  105.   else
  106.     {
  107.     ifexist,%vlcx%
  108.       {
  109.       soundplay,NotExisting.avi
  110.       ;run,%vlcx% --one-instance --qt-start-minimized "%c2%",,hide,pid1
  111.       run,%vlcx%  --one-instance "%c2%"
  112.       ;if ErrorLevel
  113.       ;   MsgBox Could not open "%C2%".
  114.       }  
  115.      else
  116.        run,"%c2%"    
  117.     }  
  118.   }
  119. }
  120. }
  121. }
  122. }
  123. }
  124. return
  125. ;-----------------------------------------
  126. FD1:
  127. Gui, Submit, NoHide ; Get user input from GUI
  128. FD1:= Drive ":\"                                          ;- folderselect from here
  129. return
  130. Folder:
  131. PRESELECT  =%fd1%         ;- search from here
  132. FileSelectFolder,MF,%PRESELECT%
  133. if MF=
  134.   return
  135. SplitPath,MF, name, dir, ext, name_no_ext, drive
  136. soundplay,NotExisting.avi
  137. Loop, %mf%\*.*, 0, 1
  138.   {
  139.   If A_LoopFileExt in %sec%
  140.     LV_Add("", A_LoopFileName, A_LoopFileLongPath)
  141.   }
  142. return
  143. ;-------------------------------------
  144. EXT:
  145. Gui, Submit, NoHide ; Get user input from GUI
  146. LV_Delete()
  147. soundplay,NotExisting.avi
  148. Loop,%fd1%\*.*, 0, 1
  149.    {
  150.    SplitPath,A_LoopFileLongPath, name, dir, ext, name_no_ext, drive
  151.    If ext In %sec%
  152.       LV_Add("", A_LoopFileName, A_LoopFileLongPath)
  153.    }
  154. LV_ModifyCol(1, "Logical SortAsc")
  155. return
  156. ;-------------------------------------  
  157. ;- Hotkey sound ON /OFF
  158. pause1:
  159. t:=!t
  160. if t
  161.   soundset,1,WAVE,mute           ; WAVE ON
  162. else
  163.   soundset,0,WAVE,mute           ; WAVE OFF
  164. return
  165. ;---------------------------------------------
  166. ;Guiclose:
  167. Process, Exist, vlc.exe
  168. If ErrorLevel
  169.    {
  170.    msgbox, 262435,Close,Want you close also Audio ?
  171.    ifmsgbox,NO
  172.       {
  173.       soundset,0,master,mute
  174.       exitapp
  175.       }
  176.    ifmsgbox,Cancel
  177.       {
  178.       return
  179.       }
  180.    else
  181.      {
  182.      soundset,0,master,mute
  183.      process,close,vlc.exe
  184.      exitapp
  185.      }
  186.    }
  187. else
  188.   {
  189.   soundset,0,master,mute
  190.   exitapp
  191.   }
  192.   Return
  193. ;-----------------------------
  194. REF:
  195.    Gui, Submit, NoHide
  196. Reload
  197. return
  198. ;============ END SCRIPT BUTTON_MENU ==============
  199. #R::Reload
  200. #S::Suspend
  201. #P::Pause
  202. #ESC::ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement