Jump to content

have problems about using variables in input boxes


 Share

Recommended Posts

hello every1 i have a problem that i cant solve myself

#include <GUIConstants.au3>
Opt("GUIOnEventMode", 1) 
$anapencere = GUICreate("emrinho hit generator alphaV1" ,400 ,200 )
GUISetOnEvent ($GUI_EVENT_CLOSE, "CLOSEClicked")
GUICtrlCreateLabel("Adres", 20, 30)
$adres = GUICtrlCreateInput("", 60, 25, 320, 25) ; i want the text in this area to be visitted
$baslatusu = GUICtrlCreateButton("başla", 155, 165, 70, 25)
GUICtrlSetOnEvent($baslatusu, "OKButton")
GUISetState(@SW_SHOW)
While 1
    Sleep(1000) ;takıl oyle
WEnd

Func OKButton()
  Send("#r")
  WinWaitActive("Run")
  Send("firefox.exe")
  Send("{enter}")
  WinWaitActive("Mozilla Firefox Başlangıç Sayfası - Mozilla Firefox") ; firefox opening page in turkish langauge
  MouseClick("left", 327, 68, 1) ; clicks at adress writing area - works at 1280x1024
  Send("& $adres &") 
  Send("{enter}")
EndFunc

what i try to do is, i want my script to visit the adress written in the text input area. but it keeps writing "& $adres &" :)

can you help me?

Link to comment
Share on other sites

check this example it may help

#include <IE.au3>
#include <GUIConstants.au3>

GUICreate("test", 260, 100)
GUICtrlCreateLabel ("put your address here:" , 10, 10, 200, 25)
$put_1 = GUICtrlCreateInput("", 10, 30, 180, 25, $GUI_DISABLE)
$do = GUICtrlCreateButton("test", 10, 65, 90, 25)
GUICtrlSetFont(-1, 12, 600)
GUISetState()

While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    If $msg = $do Then
        If GUICtrlRead ($put_1) = "" Then
            MsgBox (-1, "info" , "you did not enter your web address")
        EndIf
        If GUICtrlRead ($put_1) <>"" Then
            _IECreate (GUICtrlRead ($put_1), 0, 1, 0, 0)
        EndIf
    EndIf
WEnd

try putting your address in the input

Edited by star2

[quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]

Link to comment
Share on other sites

this is only a test example for you to be able to use the

GuiCtrlRead ()

this is your solution and my example is not meant to be used on all PCs it serves your question on how to use the text entered in the input

[quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...