Nehmen wir an, ich wähle "Option1" und "Color1". Dann schreibe ich etwas in den Freitextbereich. Wenn ich nun OK drücke, werden die bedingten Tags ausgeführt. Da Option1/Farbe1 ausgewählt ist, führt sie einen sendinput-Befehl aus mit:Bedingtes Verhalten mit Dropdown-Liste und GUI-Textfeld in AHK
blabala% text1% blabla% text2%.
Wenn ich aber wählen „option1“ und „Farbe“ wird es mit
blabla mit seiner Frau und ihre Frau text1 dann tat der Hund text2 ein Send zu tun.
Ich habe todo Teil dieses Codes geschafft. Mein Problem ist, dass wenn ich aus den Drop-Listen auswähle, es das Skript ausführt, egal was ich geschrieben habe. Ich möchte, dass es mit einem Klick auf OK ausgeführt wird und text1/text2 angezeigt wird, wo immer ich es hinstellen möchte.
#NoEnv
Gui, 1: font, s10 , Verdana
Gui, 1: Add, DropDownList, gDropDownList vDropDownList1 R2 choose1, Option1|Option2
Gui, 1: Add, DropDownList, gDropDownList vDropDownList2 R2 choose1, Color1|Color2
Gui, 1:Add, text,, Text1
Gui, 1:Add, edit, vText1
Gui, 1:Add, text,, Text2
Gui, 1:Add, edit, vText2
Return
DropDownList:
Gui, 1:Submit,NoHide
if (dropdownlist1 = "Option1") && (dropdownlist2 = "Color1")
{
MsgBox, A flower said to a be: %text1%. The bee replied %text2%
Gui 1: hide
}
else if (dropdownlist1 = "Option1") && (dropdownlist2 = "Color2")
{
MsgBox, You picked %text1% and %text2%
Gui 1: hide
}
else if (dropdownlist1 = "Option2") && (dropdownlist2 = "Color1")
{
MsgBox, A girl said %text1% when you picked %text2%
Gui 1: hide
}
else if (dropdownlist1 = "Option2") && (dropdownlist2 = "Color2")
{
MsgBox, Blabla %text1% blabla %text2%
Gui 1: hide
}
return
#j::
Gui 1: show,, DropDownGui
return