youtuber 2 Report post Posted November 20, 2016 Hello I want to open the site every time i click on the button Case $Button4 If GUICtrlRead($Button4) = "Next site" Then $sitelisturl = StringSplit(StringStripCR(GUICtrlRead($Edit1)), @LF) GUICtrlSetData($Button4, "Open Site") GUICtrlSetData($Input1, $sitelisturl) Else ShellExecute(GUICtrlRead($Input1)) GUICtrlSetData($Button4, "Next site") EndIf Share this post Link to post Share on other sites
JohnOne 1,582 Report post Posted November 20, 2016 You said there was a question, what is it? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Share this post Link to post Share on other sites
mikell 615 Report post Posted November 20, 2016 +1 Anyway this at least won't work : $sitelisturl = StringSplit(StringStripCR(GUICtrlRead($Edit1)), @LF) GUICtrlSetData($Input1, $sitelisturl) because StringSplit returns an array Share this post Link to post Share on other sites
youtuber 2 Report post Posted November 20, 2016 (edited) I want to do something like this #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 473, 327, 192, 124) $Edit1 = GUICtrlCreateEdit("", 64, 72, 329, 169) GUICtrlSetData(-1, "") $Input1 = GUICtrlCreateInput("", 64, 32, 329, 21) $Button4 = GUICtrlCreateButton("Open Site", 72, 256, 75, 25) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button4 If GUICtrlRead($Button4) = "Next site" Then $sitelisturl = GUICtrlRead($Edit1, @LF) GUICtrlSetData($Button4, "Open Site") GUICtrlSetData($Input1, $sitelisturl) Else ShellExecute(GUICtrlRead($Input1)) GUICtrlSetData($Button4, "Next site") EndIf EndSwitch WEnd Edited November 20, 2016 by youtuber Share this post Link to post Share on other sites
mikell 615 Report post Posted November 20, 2016 Not sure the way you chose is very convenient... but this works #include <GUIConstantsEx.au3> #include <StringConstants.au3> #Include <Array.au3> ; sample list $sList = "https://www.autoitscript.com" & @crlf & "https://www.google.com" $Form1 = GUICreate("Form1", 473, 327, 192, 124) $Edit1 = GUICtrlCreateEdit("", 64, 72, 329, 169) GUICtrlSetData($Edit1, $sList) $Input1 = GUICtrlCreateInput("", 64, 32, 329, 21) $Button4 = GUICtrlCreateButton("Next Site", 72, 256, 75, 25) GUISetState(@SW_SHOWNA) $aList = StringSplit(GUICtrlRead($Edit1), @crlf, $STR_ENTIRESPLIT) ;_ArrayDisplay($aList) $n = 0 While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button4 If GUICtrlRead($Button4) = "Next site" Then $n += 1 GUICtrlSetData($Input1, $aList[$n] ) GUICtrlSetData($Button4, "Open Site") Else ShellExecute(GUICtrlRead($Input1)) GUICtrlSetData($Button4, "Next site") EndIf EndSwitch WEnd 1 Share this post Link to post Share on other sites
youtuber 2 Report post Posted November 20, 2016 @mikell thank you How should I be for a message box when the links end? Thank you #include <GUIConstantsEx.au3> #include <StringConstants.au3> $sList = "https://www.autoitscript.com" & @crlf & "https://www.google.com" $Form1 = GUICreate("Form1", 473, 327, 192, 124) $Edit1 = GUICtrlCreateEdit("", 64, 72, 329, 169) GUICtrlSetData($Edit1, $sList) $Input1 = GUICtrlCreateInput("", 64, 32, 329, 21) $Button4 = GUICtrlCreateButton("Next Site", 72, 256, 75, 25) GUISetState(@SW_SHOWNA) $aList = StringSplit(GUICtrlRead($Edit1), @crlf, $STR_ENTIRESPLIT) $n = 0 While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button4 If GUICtrlRead($Button4) = "Next site" Then $n += 1 GUICtrlSetData($Input1, $aList[$n] ) If @error Then MsgBox(0,"finish","links it is over") GUICtrlSetData($Button4, "Open Site") Else ShellExecute(GUICtrlRead($Input1)) GUICtrlSetData($Button4, "Next site") EndIf EndIf EndSwitch WEnd Share this post Link to post Share on other sites
mikell 615 Report post Posted November 20, 2016 Remember the StringSplit, the number of sites is in $aList[0] Case $Button4 If GUICtrlRead($Button4) = "Next site" Then $n += 1 If $n > $aList[0] Then MsgBox(0,"finish","links it is over") Continueloop EndIf GUICtrlSetData($Input1, $aList[$n] ) GUICtrlSetData($Button4, "Open Site") Else ShellExecute(GUICtrlRead($Input1)) GUICtrlSetData($Button4, "Next site") EndIf 1 Share this post Link to post Share on other sites