Kjodiz Posted June 23, 2011 Share 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 Link to comment Share on other sites More sharing options...
Andreik Posted June 23, 2011 Share 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. Link to comment Share on other sites More sharing options...
Kjodiz Posted June 23, 2011 Author Share Posted June 23, 2011 Thanks, but it says it's missing a matching "Wend", and I can't seem to place it :/ Link to comment Share on other sites More sharing options...
Andreik Posted June 24, 2011 Share 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. Link to comment Share on other sites More sharing options...
Kjodiz Posted June 24, 2011 Author Share Posted June 24, 2011 Well this was embarrasing... Thanks for your help! =D Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now