Advertisement
Najeebsk

VLC-SEARCH.ahk

Feb 18th, 2023 (edited)
1,168
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. FileInstall , D-SEARCH.ahk, %A_ScriptDir%\D-SEARCH.ahk, 1
  9. FileSetAttrib +HS, %A_ScriptDir%\D-SEARCH.ahk, 2
  10. ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  11. FileEncoding, UTF-8
  12.  
  13.  
  14. vlcx        =%A_programfiles%\VideoLAN\VLC\vlc.exe
  15. vlcx2        =%A_windir%\notepad.exe
  16. vlcx3        =D:\TOOLS\HONEYVIEW-PORTABLE\Honeyview.exe
  17. vlcx4        =%A_windir%\explorer.exe
  18. HK1=Esc                       ;- ESC toggle sound
  19.   Hotkey,%hk1%,pause1,ON
  20. t:=""
  21. Filename1=NAJEEB SHAH KHAN PLAY-MEDIA  ( esc= sound ON/OFF )
  22. FD1=D:\                                                ;- folderselect from here
  23. all1      :="mp3,mp4,flv,aac,mpg,vob,flac,aif,aiff,m4a,m3u,m3u8,jpg,jpge,bmp,png,ico,txt,bat,vbs,ahk,au3,sh,ini,ls,doc,cmd,exe,ink"
  24. music1    :="mp3,aac,flac,aif,aiff,m4a"
  25. video1    :="mp4,flv,mpg,vob"
  26. channel1   :="m3u,m3u8"
  27. picture1   :="jpg,jpge,bmp,png,ico"
  28. text1   :="txt,bat,vbs,ahk,au3,sh,ini,ls,doc,cmd"
  29. exe1   :="exe,ink"
  30. Gui,default
  31. Gui,Color, ControlColor, Black
  32. Gui,Font, CBlack s14, Lucida Console
  33. Gui, Add, Button,x10    y5  w120 h25 gAll     , Get ALL
  34. Gui, Add, Button,x140   y5  w160 h25 gFolder  , Select-Folder
  35. Gui, Add, Button,x310   y5  w120 h25 gMusic   , MUSIC
  36. Gui, Add, Button,x440   y5  w120 h25 gVideo   , VIDEO
  37. Gui, Add, Button,x570   y5  w120 h25 gChannel   , CHANNEL
  38. Gui, Add, Button,x700   y5  w120 h25 gPicture   , PICTURE
  39. Gui, Add, Button,x830   y5  w100 h25 gText   , TEXT
  40. Gui, Add, Button,x10        y480    w140 h25 gExe   , SOFTWARE
  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.  
  49. MLV:
  50. if A_GuiEvent = Normal
  51.   {
  52.   LV_GetText(C2,A_EventInfo,2)
  53.   SplitPath,C2, name, dir, ext, name_no_ext, drive
  54.   if ext in %music1%
  55.       {
  56.       Process, Exist, vlc.exe
  57.       If ErrorLevel
  58.         Process,close,vlc.exe
  59.       Soundplay, %C2%
  60.       }
  61.   else
  62.      {
  63.  if ext in %text1%
  64.       {
  65.       Process, Exist, vlc.exe
  66.       If ErrorLevel
  67.         Process,close,vlc.exe
  68.       run, %C2% %vlcx2%
  69.       }
  70. else
  71.      {
  72.  if ext in %picture1%
  73.       {
  74.       Process, Exist, vlc.exe
  75.       If ErrorLevel
  76.         Process,close,vlc.exe
  77.       run, %C2% %vlcx3%
  78.       }
  79. else
  80.      {
  81.  if ext in %exe1%
  82.       {
  83.       Process, Exist, vlc.exe
  84.       If ErrorLevel
  85.         Process,close,vlc.exe
  86.       run, %C2% %vlcx4%
  87.       }
  88.   else
  89.     {
  90.     ifexist,%vlcx%
  91.       {
  92.       soundplay,NotExisting.avi
  93.       ;run,%vlcx% --one-instance --qt-start-minimized "%c2%",,hide,pid1
  94.       run,%vlcx%  --one-instance "%c2%"
  95.       ;if ErrorLevel
  96.       ;   MsgBox Could not open "%C2%".
  97.       }  
  98.      else
  99.        run,"%c2%"    
  100.     }  
  101.   }
  102. }
  103. }
  104. }
  105. return
  106. ;-------------------------------------
  107. Folder:
  108. PRESELECT  =%fd1%         ;- search from here
  109. FileSelectFolder,MF,%PRESELECT%
  110. if MF=
  111.   return
  112. SplitPath,MF, name, dir, ext, name_no_ext, drive
  113. soundplay,NotExisting.avi
  114. Loop, %mf%\*.*, 0, 1
  115.   {
  116.   If A_LoopFileExt in %all1%
  117.     LV_Add("", A_LoopFileName, A_LoopFileLongPath)
  118.   }
  119. return
  120. ;-------------------------------------
  121. all:
  122. LV_Delete()
  123. soundplay,NotExisting.avi
  124. Loop,%fd1%\*.*, 0, 1
  125.    {
  126.    SplitPath,A_LoopFileLongPath, name, dir, ext, name_no_ext, drive
  127.    If ext In %all1%
  128.       LV_Add("", A_LoopFileName, A_LoopFileLongPath)
  129.    }
  130. LV_ModifyCol(1, "Logical SortAsc")
  131. return
  132. ;-------------------------------------  
  133. Music:
  134. LV_Delete()
  135. soundplay,NotExisting.avi
  136. Loop, %fd1%\*.*, 0, 1
  137.   {
  138.   If A_LoopFileExt in %music1%
  139.     LV_Add("", A_LoopFileName, A_LoopFileLongPath)
  140.   }
  141. return
  142. ;-------------------------------------
  143. Video:
  144. LV_Delete()
  145. soundplay,NotExisting.avi
  146. Loop, %fd1%\*.*, 0, 1
  147.   {
  148.   If A_LoopFileExt in %video1%
  149.     LV_Add("", A_LoopFileName, A_LoopFileLongPath)
  150.   }
  151. return
  152. ;------------------------------------
  153. Channel:
  154. LV_Delete()
  155. soundplay,NotExisting.avi
  156. Loop, %fd1%\*.*, 0, 1
  157.   {
  158.   If A_LoopFileExt in %channel1%
  159.     LV_Add("", A_LoopFileName, A_LoopFileLongPath)
  160.   }
  161. return
  162. ;------------------------------------
  163. Picture:
  164. LV_Delete()
  165. soundplay,NotExisting.avi
  166. Loop, %fd1%\*.*, 0, 1
  167.   {
  168.   If A_LoopFileExt in %picture1%
  169.     LV_Add("", A_LoopFileName, A_LoopFileLongPath)
  170.   }
  171. return
  172. ;------------------------------------
  173. Text:
  174. LV_Delete()
  175. soundplay,NotExisting.avi
  176. Loop, %fd1%\*.*, 0, 1
  177.   {
  178.   If A_LoopFileExt in %text1%
  179.     LV_Add("", A_LoopFileName, A_LoopFileLongPath)
  180.   }
  181. return
  182. ;------------------------------------
  183. Exe:
  184. LV_Delete()
  185. soundplay,NotExisting.avi
  186. Loop, %fd1%\*.*, 0, 1
  187.   {
  188.   If A_LoopFileExt in %exe1%
  189.     LV_Add("", A_LoopFileName, A_LoopFileLongPath)
  190.   }
  191. return
  192. ;------------------------------------
  193. ;- Hotkey sound ON /OFF
  194. pause1:
  195. t:=!t
  196. if t
  197.   soundset,1,WAVE,mute           ; WAVE ON
  198. else
  199.   soundset,0,WAVE,mute           ; WAVE OFF
  200. return
  201. ;---------------------------------------------
  202. Guiclose:
  203. Process, Exist, vlc.exe
  204. If ErrorLevel
  205.    {
  206.    msgbox, 262435,Close,Want you close also Audio ?
  207.    ifmsgbox,NO
  208.       {
  209.       soundset,0,master,mute
  210.       exitapp
  211.       }
  212.    ifmsgbox,Cancel
  213.       {
  214.       return
  215.       }
  216.    else
  217.      {
  218.      soundset,0,master,mute
  219.      process,close,vlc.exe
  220.      exitapp
  221.      }
  222.    }
  223. else
  224.   {
  225.   soundset,0,master,mute
  226.   exitapp
  227.   }
  228. Return
  229. ;============ END SCRIPT BUTTON_MENU ==============
  230. #R::Reload
  231. #S::Suspend
  232. #P::Pause
  233. #ESC::ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement