i would like to FileAppend to a text file the name of the checkbox(s) that seleced.
so for example if i would check "msg1" & "msg2" it'll append the text of the seletced checkboxs to a txt file,
like this: FileAppend, Msg1 Msg2, c:\test.txt instead showing it in a msgbox like it is now.
and so on..
my code:
Code: Select all
#NoEnv
#SingleInstance, Force
Gui, Add, CheckBox, x15 y18 w100 h23, Msg1
Gui, Add, CheckBox, x16 y54 w100 h23, Msg2
Gui, Add, CheckBox, x16 y90 w100 h23, Msg3
Gui, Add, CheckBox, x16 y120 w100 h23, Msg4
Gui, Add, Button, x128 y34 w75 h23, OK
Gui, Show, w217 h150
Return
ButtonOK:
GuiControlGet, CHK_1,, Button1
ControlGetText, TXT_1, Button1
GuiControlGet, CHK_2,, Button2
ControlGetText, TXT_2, Button2
GuiControlGet, CHK_3,, Button3
ControlGetText, TXT_3, Button3
GuiControlGet, CHK_4,, Button4
ControlGetText, TXT_4, Button4
If (CHK_1 || CHK_2 || CHK_3 || CHK_4)
MsgBox, % (CHK_1 ? TXT_1 "`n" : "")
. (CHK_2 ? TXT_2 "`n" : "")
. (CHK_3 ? TXT_3 "`n" : "")
. (CHK_4 ? TXT_4 "`n" : "")
Else
MsgBox, Nothing selected
Return
GuiEscape:
GuiClose:
ExitApp