Kjodiz 1 Posted June 23, 2011 I'm trying to create an InputBox which you can write a website (URL?) in it. When the OK button is pressed, a browser should pop up and you'll get into the site you want. I really haven't done much with this, but as I know little about scripting and this is to learn, I'm stuck! Help? #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=F:\Scripts\AutoIt\Koda\Form1.kxf $Form1 = GUICreate("Teh Internets", 615, 438, 192, 124) $Input1 = GUICtrlCreateInput("", 208, 120, 97, 21) $Button1 = GUICtrlCreateButton("OK", 176, 184, 75, 25) $Button2 = GUICtrlCreateButton("Cancel", 264, 184, 75, 25) $Label1 = GUICtrlCreateLabel("What website would you like to go to?", 184, 80, 184, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Input1 Case $Button1 Case $Button2 ProcessClose ("AutoIt3.exe") EndSwitch WEnd Share this post Link to post Share on other sites
Andreik 66 Posted June 23, 2011 (edited) Something like this? #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=F:\Scripts\AutoIt\Koda\Form1.kxf $Form1 = GUICreate("Teh Internets", 615, 438, 192, 124) $Input1 = GUICtrlCreateInput("www.google.com", 208, 120, 200, 21) $Button1 = GUICtrlCreateButton("OK", 176, 184, 75, 25) $Button2 = GUICtrlCreateButton("Cancel", 264, 184, 75, 25) $Label1 = GUICtrlCreateLabel("What website would you like to go to?", 184, 80, 184, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $URL = GUICtrlRead($Input1) If $URL <> "" Then ShellExecute($URL) ;Open in default browser Case $Button2 Exit EndSwitch WEnd Edited June 23, 2011 by Andreik When the words fail... music speaks Share this post Link to post Share on other sites
Kjodiz 1 Posted June 23, 2011 Thanks, but it says it's missing a matching "Wend", and I can't seem to place it :/ Share this post Link to post Share on other sites
Andreik 66 Posted June 24, 2011 Seems you didn't copy the entire code. Last line is "WEnd" that missing for you. When the words fail... music speaks Share this post Link to post Share on other sites
Kjodiz 1 Posted June 24, 2011 Well this was embarrasing... Thanks for your help! =D Share this post Link to post Share on other sites