Advertisement
Najeebsk

RUNNER.ahk

Oct 31st, 2023
1,273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #NoEnv
  2. #SingleInstance, Force
  3. SetBatchLines, -1
  4. ini = %A_Scriptdir%\RUNNER.ini ; Replace with your INI path
  5. spath := {}
  6. Gui, New
  7. ;Gui, Color, 884488
  8. Gui New, +Hwndmygui
  9. WinSet, TransColor, EEAA99
  10. Gui, +ToolWindow -Border
  11. Gui,Font,S14 Bold,Calibri
  12. Loop {
  13.  IniRead, sname, %ini%, Shortcuts, ShortcutName%A_Index%
  14.  If (sname = "ERROR")
  15.   Break
  16.  IniRead, thisPath, %ini%, Shortcuts, ShortcutPath%A_Index%
  17.  If FileExist(thisPath) {
  18.   spath[sname] := thisPath
  19.   Gui, Add, Button, w200 h20 y+m gProg, %sname%
  20.  }
  21. }
  22. Gui, Show, X775 Y2 W240 H720, Najeeb Run
  23. Return
  24.  
  25. Prog:
  26. If FileExist(thisPath := spath[A_GuiControl]) {
  27.  SplitPath, thisPath, fn
  28.  If WinExist("ahk_exe " fn)
  29.   WinActivate
  30.  Else Run, %thisPath%
  31. } Else MsgBox, 48, File not found, %thisPath%
  32. Return
  33. F1::
  34.     if (WinExist("ahk_id " mygui))
  35.         Gui %mygui%: Hide
  36.     else
  37.         Gui %mygui%: Show
  38. Return
  39.  
  40. #R::Reload  ;<--  ~ Reload Script ~
  41. #S::Suspend ;<--  ~ Suspend Script ~
  42. #P::Pause   ;<--  ~ Pause Script ~
  43. #M::WinMinimize, ;<--  ~ Minimize Script ~
  44. ESC::ExitApp     ;<--  ~ Exit Script ~
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement