Advertisement
Najeebsk

SEARCH-TEXT.ahk

Apr 7th, 2023 (edited)
1,540
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; <COMPILER: v1.1.34.04>
  2. /*   INFO
  3.    READ TEXT EXT=txt,ini,bat,m3u,ahk IN SEARCH FOLDER (PUTTING TXT FILES IN SEARCH FOLDER AND READ)
  4.    Written by: Najeeb Shah Khan (najeebshahkhan@gmail.com)
  5.    Last Modified: 4-6-2023
  6. */
  7. ;#warn
  8. #NoEnv
  9. #LTrim
  10. #SingleInstance, Force
  11. Process, Priority, , A
  12. SendMode, Input
  13. SetBatchLines, -1
  14. ;#NoTrayIcon
  15. SetKeyDelay 0    ; In case SendInput is not available
  16. SetTitleMatchMode RegEx
  17. ;SetWorkingDir %A_WorkingDir% ;%A_ScriptDir%  
  18. Folder := A_WorkingDir . "\SEARCH"
  19. ;Ext=txt,ini,bat,m3u,ahk
  20. ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  21. FileCreateDir, %A_ScriptDir%\DATA
  22. FileCreateDir, %A_ScriptDir%\SEARCH
  23. FileInstall , SEARCH-TEXT.ahk, %A_ScriptDir%\DATA\SEARCH-TEXT.ahk, 1
  24. FileInstall , S69.she, %A_ScriptDir%\DATA\S69.she, 1
  25. FileInstall , SkinH_EL.dll, %A_ScriptDir%\DATA\SkinH_EL.dll, 1
  26. FileSetAttrib +HS, %A_ScriptDir%\DATA\SEARCH-TEXT.ahk, 2
  27. FileSetAttrib +HS, %A_ScriptDir%\DATA\S69.she, 2
  28. FileSetAttrib +HS, %A_ScriptDir%\DATA\SkinH_EL.dll, 2
  29. FileSetAttrib +HS, %A_ScriptDir%\DATA, 2
  30. ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  31. SkinForm(Apply, A_ScriptDir . "\DATA\SkinH_EL.dll", A_ScriptDir . "\DATA\S69.she")
  32. OnExit, GetOut
  33. Gui,Font,S16 CRed Bold,Verdana ;Calibri
  34. Gui, Add, Text,CRed x75 y2, NAJEEB SEARCH FILES FOLDERS AND COMMANDS
  35. Gui,Font,S12 CBlack ;Bold,Verdana ;Calibri
  36. Gui, Add, Edit, x10 y30 w786 vneedle grefresh,
  37. Gui, Add, ListBox, x10 y62 vresults r28 w786
  38. Gui, Add, Button, x218 y580 gRUN,Run Exe
  39. Gui, Add, Button, x316 y580 gRUN3,Run Cmd
  40. Gui, Add, Button, x420 y580 gRUN4,Open Folder
  41. Gui, Add, Button, x550 y580 gRUN5,Video
  42. Gui, Add, Button, x620 y580 gMP3,MP3
  43. Gui, Add, Button, x680 y580 gRUN6,WEB
  44. Gui, Add, Button, x744 y580 gClip2,CLIP
  45. listboxvisible := true
  46. Gui, Add, DropDownList, x10 y582 W200 gDDL vColorChoice,
  47. GoSub, DDL
  48. Gui, Add, Text, x20 y640 w800,-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  49. Gui, Show, w810 h660, NAJEEB CHANGE EXTENSION AND RENAMER
  50. GuiControl, Focus, needle
  51. Return
  52. Refresh:
  53. Gui, Submit, NoHide
  54. choicelimit := 0
  55. GuiControl,, results, |
  56. listbox:=""
  57. if (needle != "")
  58. {
  59. Guicontrol, show, results
  60. listboxvisible := true
  61. Loop, parse, FileContents, `n, `r
  62.     {
  63.         haystack:=A_LoopField
  64.         position := instr(haystack, needle)
  65.         if (position = 1) ;if it matches from the left
  66.         {
  67.             listbox.="|" . haystack
  68.             choicelimit := choicelimit + 1
  69.         }
  70.     }
  71. Loop, parse, FileContents, `n, `r
  72.     {
  73.         haystack:=A_LoopField
  74.         position := instr(haystack, needle)
  75.         if (position > 1)
  76.         {
  77.             listbox.="|" . haystack
  78.             choicelimit := choicelimit + 1
  79.         }
  80.     }
  81. if (listbox = "" || listbox = "|") {
  82. listboxvisible := false
  83. return
  84. }
  85. GuiControl,, results, %listbox%
  86. GuiControl, choose, results, 1
  87. resultchosen := 1
  88. }
  89. return
  90. DDL:
  91. Loop, %Folder%\*.*, 0, 1
  92. {
  93. GuiControl, , ColorChoice, %A_LoopFileName%  
  94. GuiControlGet, ColorChoice
  95. FileRead, FileContents, %A_WorkingDir%\SEARCH\%ColorChoice%
  96. Sort, FileContents
  97. }
  98. Return
  99. Run:
  100. Gui,submit,nohide
  101. Run, %results%
  102. Return
  103. Run3:
  104. Gui,submit,nohide
  105. Run, %comspec% /c %results%
  106. Return
  107. Run4:
  108. Gui,submit,nohide
  109. Run, C:\Windows\explorer.exe shell:%results%
  110. Return
  111. Run5:
  112. Gui,submit,nohide
  113. Run, %A_programfiles%\VideoLAN\VLC\vlc.exe %results%
  114. Return
  115. MP3:
  116. Gui,submit,nohide
  117. Soundplay, %results%
  118. Return
  119. Run6:
  120. Gui,submit,nohide
  121. Run, "%A_programfiles%\Mozilla Firefox\firefox.exe" %results%
  122. Return
  123. Clip2:
  124. Gui,submit,nohide
  125. Clipboard := results
  126. ClipWait  ; Wait for the clipboard to contain text.
  127. MsgBox %clipboard%
  128. Return
  129. ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  130. GetOut:
  131. GuiClose:
  132. Gui, Hide
  133. SkinForm(0)
  134. ExitApp
  135. return
  136.  
  137. SkinForm(Param1 = "Apply", DLL = "", SkinName = ""){
  138.     if(Param1 = Apply){
  139.         DllCall("LoadLibrary", str, DLL)
  140.         DllCall(DLL . "\SkinH_AttachEx", AStr,SkinName, Str,"mhgd")
  141.     }else if(Param1 = 0){
  142.         DllCall(DLL . "\USkinExit")
  143.         }
  144. }
  145. ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  146. #R::Reload  ;<--  ~ Reload Script ~
  147. #S::Suspend ;<--  ~ Suspend Script ~
  148. #P::Pause   ;<--  ~ Pause Script ~
  149. #M::WinMinimize, ;<--  ~ Minimize Script ~
  150. ESC::ExitApp     ;<--  ~ Exit Script ~
  151. ;=-=-=-=-=-=-=-=-=-=- END SCRIPT -=-=-=-=-=-=-=-=-=-=-=-
  152.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement