@@ -107,11 +107,13 @@ loop, %section2_keys%
107107
108108Gui , Font , S12 CDefault, Franklin Gothic Medium
109109Gui , Add , Button , x30 y%buttonStartingY% w100 h30, Add Script
110+ Gui , Add , Button , x150 y%buttonStartingY% w100 h30, Delete Script
111+ ; Gui, Add, Button, x275 y%buttonStartingY% w100 h30, Variables ; Uncomment if you wish to have a button to show Variables assigned by the script
110112Gui , Add , Button , x400 y%buttonStartingY% w100 h30, Cancel
111113Gui , Add , Button , x520 yp w100 h30, SAVE
112114Gui , Font , S10 CDefault, Franklin Gothic Medium
113115Gui , Add , Text , x30 yp + 40 w650, Clicking 'SAVE' will save the settings above and reload MASTER- SCRIPT.ahk and the checked scripts above.
114- ; Gui, Add, Button, x400 yp+32 w220 h20, Variables ; Uncomment if you wish to have a button to show Variables assigned by the script
116+
115117Gui , Show , w%guiWidth% h%guiHeight%
116118return
117119
@@ -142,6 +144,77 @@ INI_Save(inifile)
142144reload
143145return
144146
147+ ButtonDeleteScript :
148+ scriptSectionKeys := round (section2_keys / 3 )
149+ delScriptGUIH := (scriptSectionKeys * 40 )
150+ delScriptGUIW := 580
151+ delScriptLVH := (delScriptGUIH - 40 )
152+ delScriptLVW := 560
153+
154+ Gui , DelScript:New, , Delete a Script
155+ Gui , DelScript:Font , S12 CDefault, Franklin Gothic Medium
156+ Gui , DelScript:Add , Text , , Double- click the script you would like to remove below:
157+ Gui , DelScript:Add , ListView , r%scriptSectionKeys% w%delScriptLVW% h%delScriptLVH% gdelListView, #| Script| Enabled ?
158+
159+ loop , %scriptSectionKeys%
160+ {
161+ LV_Add (,A_Index , Scripts_nameScript%A_Index %, Scripts_loadScript%A_Index % )
162+ }
163+ LV_ModifyCol (2 )
164+ Gui , DelScript:Show , w580 h%delScriptGUIH%
165+
166+ delListView :
167+ if (A_GuiEvent = " DoubleClick" )
168+ {
169+ LV_GetText (RowText, A_EventInfo )
170+ scriptToDel := % Scripts_nameScript%A_EventInfo % ; Get the text from the row's first field.
171+ MsgBox , 36 , Delete this Script?, Is this the script you want to delete ?`n# %A_EventInfo %: %scriptToDel%
172+ IfMsgBox , No
173+ goto delScriptNo
174+ IfMsgBox , Yes
175+ newNumberOfKeySets := (section2_keys - 3 )
176+ currentAltCounter := 1
177+ Loop , %scriptSectionKeys%
178+ {
179+ If (A_Index = A_EventInfo ) {
180+ Continue
181+ }
182+ tempScripts_loadScript%currentAltCounter% := % Scripts_loadScript%A_Index %
183+ tempScripts_nameScript%currentAltCounter% := % Scripts_nameScript%A_Index %
184+ tempScripts_pathScript%currentAltCounter% := % Scripts_pathScript%A_Index %
185+ currentNameValue := % tempScripts_nameScript%currentAltCounter%
186+ currentPathValue := % tempScripts_pathScript%currentAltCounter%
187+ currentLoadValue := % tempScripts_loadScript%currentAltCounter%
188+ currentAltCounter + = 1
189+ }
190+ Loop , %section2_keys%
191+ {
192+ Scripts_loadScript%A_Index % := % tempScripts_loadScript%A_Index %
193+ Scripts_nameScript%A_Index % := % tempScripts_nameScript%A_Index %
194+ Scripts_pathScript%A_Index % := % tempScripts_pathScript%A_Index %
195+ }
196+ Scripts_loadScript%scriptSectionKeys% := 0
197+ Scripts_nameScript%scriptSectionKeys% :=
198+ Scripts_pathScript%scriptSectionKeys% :=
199+ IniDelete , %inifile%, Scripts, loadScript%scriptSectionKeys%
200+ IniDelete , %inifile%, Scripts, nameScript%scriptSectionKeys%
201+ IniDelete , %inifile%, Scripts, pathScript%scriptSectionKeys%
202+ scriptSectionKeys - = 1
203+ Loop , %scriptSectionKeys%
204+ {
205+ currentLoadValue := % Scripts_loadScript%A_Index %
206+ currentNameValue := % Scripts_nameScript%A_Index %
207+ currentPathValue := % Scripts_pathScript%A_Index %
208+ IniWrite , %currentLoadValue%, %inifile%, Scripts, loadScript%A_Index %
209+ IniWrite , %currentNameValue%, %inifile%, Scripts, nameScript%A_Index %
210+ IniWrite , %currentPathValue%, %inifile%, Scripts, pathScript%A_Index %
211+ }
212+ delScriptNo :
213+ Gui , DelScript:Destroy
214+ reload
215+ }
216+ return
217+
145218ButtonSAVE :
146219Gui , Submit
147220; Setting the location if it got changed
0 commit comments