@@ -78,8 +78,9 @@ ProfileLoad(profileName, *) {
78
78
return
79
79
}
80
80
81
- try {
82
- Loop Reg REG_KEY_PATH " \Profiles\" profileName {
81
+ Loop Reg REG_KEY_PATH " \Profiles\" profileName {
82
+ profileItemLoad :
83
+ try {
83
84
local value := RegRead ()
84
85
85
86
switch A_LoopRegName {
@@ -126,7 +127,8 @@ ProfileLoad(profileName, *) {
126
127
continue
127
128
128
129
local hotkeyDataMatch
129
- RegExMatch A_LoopField , " ^(?P<Hotkey>.+?)%(?P<Scope>\d)%(?P<Action>\d)$" , & hotkeyDataMatch
130
+ RegExMatch A_LoopField , " ^(?P<Hotkey>.+?)%(?P<Scope>\d)%(?P<Action>\d)$"
131
+ , & hotkeyDataMatch
130
132
131
133
configured_hotkeys.Push({
132
134
Hotkey : hotkeyDataMatch[" Hotkey" ],
@@ -155,18 +157,24 @@ ProfileLoad(profileName, *) {
155
157
}
156
158
}
157
159
}
160
+ } catch as err {
161
+ add_log(" Load Profile error: " err.Message)
162
+ switch MsgBox (Format ("
163
+ (
164
+ An error occurred whilst loading the profile '{}'.
165
+ The profile is likely from an older version of EC Autoclicker.
166
+
167
+ Key: {}
168
+ Message: {}
169
+ )" , profileName, A_LoopRegName, err.Message)
170
+ , " Load Profile" , " CancelTryAgainContinue Iconx 262144" ) {
171
+ case " Cancel" :
172
+ refreshProfileSelectionLists()
173
+ return
174
+ case " TryAgain" :
175
+ goto profileItemLoad
176
+ }
158
177
}
159
-
160
- add_log(" Completed profile load" )
161
- } catch as err {
162
- add_log(" Load Profile error: " err.Message)
163
- MsgBox Format ("
164
- (
165
- An error occurred whilst loading the profile '{}'.
166
- This is likely due to corrupt data.
167
-
168
- Message: {}
169
- )" , profileName, err.Message), " Load Profile" , " Iconx 8192 "
170
178
}
171
179
}
172
180
0 commit comments