This group of radio buttons returns the number but I need the word that was selected. This works--hurray!--to pick a color from a list and have it typed into notepad but these If statements look clumsy.
I thought maybe an array (Blue, Green, Orange, Purple, Yellow, White, Passthru) using the radio button number as the index would work but I couldn't find the correct syntax for the Send. Can someone please tell me what's the best way to do this?
Code: Select all
!F3:: ;alt+F3
Gui, New
Gui, Add, Radio, vBatt, &Blue 1500mah
Gui, Add, Radio,, &Green 1300mah
Gui, Add, Radio,, &Orange 1300mah
Gui, Add, Radio,, &Purple 1300mah
Gui, Add, Radio,, &Yellow 2200mah
Gui, Add, Radio,, &White 1600mah
Gui, Add, Radio,, P&assthru
Gui, Add, Button, Default, Submit
Gui, Show,, Choose Battery
return
GuiClose:
ButtonSubmit:
Gui, Submit
If Batt = 1
Batt = Blue
If Batt = 2
Batt = Green
If Batt = 3
Batt = Orange
If Batt = 4
Batt = Purple
If Batt = 5
Batt = Yellow
If Batt = 6
Batt = White
If Batt = 7
Batt = Passthru
WinActivate, Untitled - Notepad
Send %Batt%
return