-
Notifications
You must be signed in to change notification settings - Fork 0
/
AutoRecord.ahk
99 lines (85 loc) · 2.93 KB
/
AutoRecord.ahk
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
SetTitleMatchMode, 2
#SingleInstance FORCE
;Debug := % "TRUE"
;Variables and Constants for Sleeping
SECONDS_IN_MINUTES := 60
MILLISECONDS_IN_SECONDS := 1000
MinutesForWorship := SECONDS_IN_MINUTES * MILLISECONDS_IN_SECONDS * 40
MinutesForSermon := SECONDS_IN_MINUTES * MILLISECONDS_IN_SECONDS * 40
MinutesForClosing := SECONDS_IN_MINUTES * MILLISECONDS_IN_SECONDS * 20
FilePath := "E:\Documents\REAPER Media\"
TemplateName := "Weekend Service"
if Debug
{
MinutesForWorship /= 1000
MinutesForSermon /= 1000
MinutesForClosing /= 1000
}
WinGetActiveTitle, LastWindow
SplashImage, , H100 W500, % "The Audio recording for the service is setting up. Please Do not touch anything while this window is displayed. Thank you.", % "Audio Recording", % "Weekend Service Recording"
;Check to see if Reaper is already open and if not opens it
IfWinNotExist, ahk_class REAPERwnd
{
Run, % "C:\Program Files\REAPER (x64)\reaper.exe"
}
WinActivate, ahk_class REAPERwnd
WinWaitActive, ahk_class REAPERwnd
Sleep, 500
IfWinExist, % "About REAPER"
{
WinActivate, % "About REAPER"
WinWaitActive, % "About REAPER"
Sleep, 200
Send, {ENTER}
}
;Initialize Menus for Use
WinActivate, "REAPER"
Send, !f
Sleep, 500
Send,{ESCAPE}
Sleep, 500
Send, !a
Sleep, 500
Send,{ESCAPE}
Sleep, 500
;Create new project and save it with correct filepath and filename
WinMenuSelectItem, % "REAPER",, % "File", % "Project templates", % TemplateName
Sleep, 2000
FormatTime, FileName, , yyyy-MM-dd
FileName .= "-" . (A_Hour + 1) . "_00.RPP"
WinMenuSelectItem, % "REAPER",, % "File", % "Save"
WinWaitActive, % "Save Project"
Sleep, 500
Send, % FilePath
Sleep, 500
Send, % FileName
Sleep, 500
Send, {Enter}
Sleep, 500
WinActivate, % LastWindow
SplashImage, Off
;Ready project for recording
WinMenuSelectItem, % "REAPER",, % "Actions", % "Custom Actions", % "Go to Start"
WinMenuSelectItem, % "REAPER",, % "Actions", % "Custom Actions", % "Arm All"
Sleep, 1000
;Start recording Project
WinMenuSelectItem, % "REAPER",, % "Actions", % "Custom Actions", % "Record"
Sleep, % MinutesForWorship
;Stop Recording Band
WinMenuSelectItem, % "REAPER",, % "Actions", % "Custom Actions", % "Arm All"
WinMenuSelectItem, % "REAPER",, % "Actions", % "Custom Actions", % "Toggle Arm Group 01"
Sleep, % MinutesForSermon
;Resume Recording Band
WinMenuSelectItem, % "REAPER",, % "Actions", % "Custom Actions", % "Arm All"
Sleep, % MinutesForClosing
;Stop Recording
WinMenuSelectItem, % "REAPER",, % "Actions", % "Custom Actions", % "Stop"
Sleep, 500
WinMenuSelectItem, % "REAPER",, % "Actions", % "Custom Actions", % "Unarm All"
Sleep, 500
WinMenuSelectItem, % "REAPER",, % "Actions", % "Custom Actions", % "Unselect All"
Sleep, 500
WinMenuSelectItem, % "REAPER",, % "Actions", % "Custom Actions", % "Save"