Advertisement
Najeebsk

RUN.ahk

Jun 4th, 2022 (edited)
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; <COMPILER: v1.1.32.00>
  2. #SingleInstance Force
  3. SetworkingDir, %A_workingDir%
  4.  
  5. F1::
  6.     InputBox, SearchString, , % "Input string to search. By Najeeb"
  7.     ResultList := []
  8.     ChosenString := ""
  9.     Loop, Read, %A_workingDir%\RUN.txt
  10.     {
  11.         if (InStr(A_LoopReadLine, SearchString))
  12.         {
  13.             ResultList.Push(A_LoopReadLine)
  14.         }
  15.     }
  16.     if (!ResultList.Length())
  17.     {
  18.         MsgBox % "No match found!"
  19.         return
  20.     }
  21.     Gui, DisplayResults:New,-MaximizeBox -MinimizeBox  , Search results By Najeeb
  22.     Gui, Add, Text, w250, % "Click on a line to select and Run it."
  23.     for key, value in ResultList
  24.     {
  25.         if (key = 1)
  26.             Gui, Add, Radio, gSelectResult vChosenString, %value%
  27.         else
  28.             Gui, Add, Radio, gSelectResult, %value%
  29.     }
  30.     Gui, DisplayResults:Show
  31.     return
  32.    
  33. SelectResult:
  34.    Gui, DisplayResults:Submit
  35.     Run % ResultList[ChosenString]
  36.     return
  37. #R::Reload
  38. #S::Suspend
  39. #P::Pause
  40. ESC::ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement