daily pastebin goal
28%
SHARE
TWEET

AHK Blank Template by GroggyOtter

ZeroAccend Apr 21st, 2016 (edited) 2,001 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;Blank Template written by GroggyOtter
  2.  
  3. ;============================== Start Auto-Execution Section ==============================
  4. ; Always run as admin
  5. if not A_IsAdmin
  6. {
  7.    Run *RunAs "%A_ScriptFullPath%"  ; Requires v1.0.92.01+
  8.    ExitApp
  9. }
  10.  
  11. ; Keeps script permanently running
  12. #Persistent
  13.  
  14. ; Determines how fast a script will run (affects CPU utilization).
  15. ; The value -1 means the script will run at it's max speed possible.
  16. SetBatchLines, -1
  17.  
  18. ; Avoids checking empty variables to see if they are environment variables.
  19. ; Recommended for performance and compatibility with future AutoHotkey releases.
  20. #NoEnv
  21.  
  22. ; Ensures that there is only a single instance of this script running.
  23. #SingleInstance, Force
  24.  
  25. ; Makes a script unconditionally use its own folder as its working directory.
  26. ; Ensures a consistent starting directory.
  27. SetWorkingDir %A_ScriptDir%
  28.  
  29. ; sets title matching to search for "containing" instead of "exact"
  30. SetTitleMatchMode, 2
  31.  
  32. GroupAdd, saveReload, %A_ScriptName%
  33.  
  34. return
  35.  
  36. ;============================== Save Reload / Quick Stop ==============================
  37. #IfWinActive, ahk_group saveReload
  38.  
  39. ; Use Control+S to save your script and reload it at the same time.
  40. ~^s::
  41.     TrayTip, Reloading updated script, %A_ScriptName%
  42.     SetTimer, RemoveTrayTip, 1500
  43.     Sleep, 1750
  44.     Reload
  45. return
  46.  
  47. ; Removes any popped up tray tips.
  48. RemoveTrayTip:
  49.     SetTimer, RemoveTrayTip, Off
  50.     TrayTip
  51. return
  52.  
  53. ; Hard exit that just closes the script
  54. ^Esc::
  55. ExitApp
  56.  
  57.  
  58. #IfWinActive
  59. ;============================== Main Script ==============================
  60.  
  61. ; Your main code here.
  62. ; Global hotkeys
  63. ; Global hotstrings
  64. ; etc...
  65.  
  66. ;============================== Program 1 ==============================
  67. ; Evertything between here and the next #IfWinActive will ONLY work in someProgram.exe
  68. ; This is called being "context sensitive"
  69. ; #IfWinActive, ahk_exe someProgram.exe
  70.  
  71.  
  72.  
  73. ; #IfWinActive
  74. ;============================== ini Section ==============================
  75. ; Do not remove /* or */ from this section. Only modify if you're
  76. ; storing values to this file that need to be permanantly saved.
  77. /*
  78. [SavedVariables]
  79. Key=Value
  80. */
  81. ;============================== GroggyOtter ==============================
  82. ;============================== End Script ==============================
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top