Linkman81 Posted April 23, 2008 Share Posted April 23, 2008 (edited) Hi there. I'm a weekend AutoIt user...usually to automate some game I'm playing to farm gold, or to open up my favorite DOS games with DosBox. I'm recently trying to mess with GUIs and I can't seem to figure out how to retrieve the text entered into an input box or edit box. I wanted to make a GUI where I could enter text in an input box or edit box (I guess I assume you can accomplish the same thing with both types of boxes. Correct me if I'm wrong) and then the script would type that text into a web pages input box for me later. I just can't figure out the command to retrieve the text that was entered into the box. I've tried messing with GUICTRLREAD but I can't get it to work. This is my current script. It is to track my UPS packages. It opens up an Internet explorer window and does all the typing for me. expandcollapse popup#include <GUIConstants.au3> GUICreate("Track Packages", 340, 120) $tracking = GuiCtrlCreateEdit("Enter Tracking Numbers Here", 10, 10, 160, 80) $button = GuiCtrlCreateButton("Track!", 200, 50, 100, 30) GuiSetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $button Run ("C:\program files\internet explorer\iexplore.exe") WinWaitActive ("Google - Windows Internet Explorer") Sleep (1000) Send ("^o") Sleep (1000) Send ("www.ups.com/tracking/tracking.html") Sleep (500) Send ("{enter}") WinWaitActive ("UPS: Tracking Information - Windows Internet Explorer") Sleep (1000) Send ("^f") Sleep (500) Send ("Tracking Numbers:") Send ("{enter}") Sleep (500) Send ("{esc}") Sleep (500) Send ("{tab}") Sleep (500) guictrlread ($tracking,1);??????????????????????????????????????????? Sleep (500) Send ("{TAB 2}") Sleep (500) Send ("{enter}") Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd Someone please help me to know what the heck I need to do to retrieve the text. Brandon Edited April 23, 2008 by Linkman81 Link to comment Share on other sites More sharing options...
newbiescripter Posted April 23, 2008 Share Posted April 23, 2008 Here is a simple example in how you get the data that is typed into an inputbox: $name = InputBox("Name","Type in your name","Name Here") MsgBox(0,"Name","Your name is: " & $name) Regards Link to comment Share on other sites More sharing options...
spudw2k Posted April 23, 2008 Share Posted April 23, 2008 (edited) Use the GUICtrlRead() Function to read your $tracking Edit ctrl. $str = GUICtrlRead($tracking) $str then equals the text in $tracking. Edited April 23, 2008 by spudw2k Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
Recommended Posts