-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReloadScripts.ahk
More file actions
40 lines (35 loc) · 818 Bytes
/
ReloadScripts.ahk
File metadata and controls
40 lines (35 loc) · 818 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#NoEnv
#SingleInstance, ignore
SendMode Input
SetWorkingDir C:\Users\Theseus\Documents\AutoHotKey
DetectHiddenWindows On
DetectHiddenText On
global scripts := []
getFiles(Folder)
{
Loop %Folder%\*.ahk
{
scripts.Push(A_LoopFileName)
}
}
^!r::
;Kill Running Processes
WinGet, id, list, ahk_class AutoHotkey
Loop, %id%
{
this_ID := id%A_Index%
WinGetTitle, title, ahk_id %this_ID%
SkriptPath := RegExReplace(title, " - AutoHotkey v" A_AhkVersion)
If InStr(SkriptPath, A_ScriptFullPath)
continue
WinClose, %SkriptPath% ahk_class AutoHotkey
}
;Start Scripts
scripts := []
getFiles("C:\Users\Theseus\Documents\AutoHotKey")
Loop % scripts.Length() {
script := % scripts[A_Index]
Run %script%
}
MsgBox % "Running " scripts.Length() . " scripts."
Reload