-
Notifications
You must be signed in to change notification settings - Fork 0
/
CopySettings_2-AHK_v2.ahk
133 lines (98 loc) · 3.59 KB
/
CopySettings_2-AHK_v2.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
;; AutoHotKey script
;; https://www.autohotkey.com/
;; AHK V1.0
;; Description:
;; This script copies settings from various programs to a single
;; directory to enable easy backup to a NAS or Cloud service
;; This is convenient since settings of different applications are scattered
;; around the Windows system.
;; Developer
;; Antoine van Kampen
;; www.skippyweb.eu
;; April 2023
;; License: GPL
;; Currently the following settings are copied:
;; **** DORICO 4
;; **** DORICO 5
;; **** HALion ****
;; **** SPECTRALAYERS ****
;; **** SONARWORKS/SOUNDID PROFILES ****
#Requires AutoHotkey v2.0 ;; See also https://www.autohotkey.com/docs/v2/Program.htm#launcher
;;
;; First make target directory
;;
;; Note: if CopySettings_1-AHK_v1.ahk is already executed then the TargetDir
;; and README.txt do already exist.
;;
TimeString := FormatTime(,"yyyy-MMM-dd")
TargetDir := "E:\Program Data\SettingsBackup\" . TimeString
if not DirExist(TargetDir)
DirCreate(TargetDir)
FileAppend "`n`nBackup of settings (AHK V2.0). `n Time: " . TimeString . "`n Target directory: " TargetDir, TargetDir . "\0_README.txt" ;- append to README.txt file
;;
;; Now copy all settings one-by-On
;;
;; **** DORICO 4 ****
SourceDir := "C:\Users\Skippy Studio\AppData\Roaming\Steinberg"
DirCreate TargetDir "\Dorico 4"
Loop Files SourceDir "\Dorico 4*", "D" ;;See https://www.autohotkey.com/docs/v2/lib/LoopFiles.htm
{
try
DirCopy A_LoopFilePath, TargetDir "\Dorico 4\" A_LoopFileName, 1
catch
MsgBox "Dorico 4 ROAMING. An error occurred when copying the directory.`n`n" A_LoopFilePath
}
;; **** DORICO 5 ****
SourceDir := "C:\Users\Skippy Studio\AppData\Roaming\Steinberg"
DirCreate TargetDir "\Dorico 5"
Loop Files SourceDir "\Dorico 5*", "D" ;;See https://www.autohotkey.com/docs/v2/lib/LoopFiles.htm
{
try
DirCopy A_LoopFilePath, TargetDir "\Dorico 5\" A_LoopFileName, 1
catch
MsgBox "Dorico 5 ROAMING. An error occurred when copying the directory.`n`n" A_LoopFilePath
}
;; **** HALion ****
SourceDir := "C:\Users\Skippy Studio\AppData\Roaming\Steinberg"
DirCreate TargetDir "\HALion"
Loop Files SourceDir "\HALion*", "D"
{
try
DirCopy A_LoopFilePath, TargetDir "\HALion\" A_LoopFileName, 1
catch
MsgBox "HALION ROAMING. An error occurred when copying the directory.`n`n" A_LoopFilePath
}
SourceDir := "C:\Users\Skippy Studio\Documents\Steinberg"
DirCreate TargetDir "\HALion\Documents"
Loop Files SourceDir "\HALion*", "D"
{
try
DirCopy A_LoopFilePath, TargetDir "\HALion\Documents\" A_LoopFileName, 1
catch
MsgBox "HALION Documents. An error occurred when copying the directory.`n`n" A_LoopFilePath
}
;; **** SPECTRALAYERS ****
SourceDir := "C:\Users\Skippy Studio\AppData\Roaming\Steinberg"
Loop Files SourceDir "\SpectraLayers*", "D"
{
try
DirCopy A_LoopFilePath, TargetDir "\SpectraLayers\" A_LoopFileName, 1
catch
MsgBox "SPECTRALAYERS. An error occurred when copying the directory.`n`n" A_LoopFilePath
}
;;Remove the Cache directory
Loop Files TargetDir "\SpectraLayers\SpectraLayers*", "D"
{
try
DirDelete A_LoopFilePath "\Cache", 1 ;S"\" A_LoopFileName, 1
catch
MsgBox "An error occurred when deleting a directory.`n`n" A_LoopFilePath "\Cache"
}
;; **** SONARWORKS/SOUNDID ****
SourceDir := "C:\Users\Skippy Studio\AppData\Local\Sonarworks\SoundID Reference\Sonarworks Projects"
DirCreate TargetDir "\SoundID"
SplitPath SourceDir, &SourceDirName ; Extract only the directory name from its full path.
try
DirCopy SourceDir, TargetDir "\SoundID\" SourceDirName, 1
catch
MsgBox "SoundID. An error occurred when copying the directory.`n`n" A_LoopFilePath