kats Posted October 24, 2008 Share Posted October 24, 2008 The sample I made below illustrates the way that AutoIt performs the send function. I used to use another program that would allow the macro to paste the given variable instead of typing it out which can be kind of slow (kind of looks like someone is actually typing it out). An example would be your basic cut and paste, when you paste it its there you dont have to wait for it to be typed out. I tried using a variable instead of typing it out in the send, but its still the same slow typing result. When I write scripts to fill out long boring repitive forms I need it to fill them out quickly so I dont have to wait so long. If you have any simple solutions great, if not dont worry about it, just thought someone might. $gi="Testing one two three four five six seven eight nine ten" Run("notepad.exe") sleep(3000) send($gi) send("{enter}") sleep(1000) send("Testing one two three four five six seven eight nine ten {enter}") sleep(1000) send($gi) send("{enter}") sleep(1000) send("Testing one two three four five six seven eight nine ten {enter}") sleep(1000) send($gi) send("{enter}") sleep(1000) send("Testing one two three four five six seven eight nine ten {enter}") sleep(1000) Kats Link to comment Share on other sites More sharing options...
cartman380 Posted October 24, 2008 Share Posted October 24, 2008 Something like this should do it. $gi="Testing one two three four five six seven eight nine ten" ClipPut($gi) Run("notepad.exe") sleep(3000) Send("^v" & @CR) sleep(1000) Send("^v"& @CR) sleep(1000) Send("^v"& @CR) sleep(1000) Send("^v"& @CR) sleep(1000) Send("^v"& @CR) sleep(1000) Send("^v"& @CR) sleep(1000) Link to comment Share on other sites More sharing options...
spudw2k Posted October 24, 2008 Share Posted October 24, 2008 (edited) You could use something like this, but it removes any text in the "control"$txt = "Text Here" Run("notepad.exe") WinWait("Untitled -") $txt = ControlGetText("Untitled -", "", "Edit1") & $txt ControlSetText("Untitled -", "", "Edit1", $txt)edit: corrected example Edited October 24, 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...
kats Posted October 24, 2008 Author Share Posted October 24, 2008 I honestly appreciate your help, your solution worked great! Have a nice weekend, Kats Link to comment Share on other sites More sharing options...
kats Posted October 24, 2008 Author Share Posted October 24, 2008 What if you wanted to clipput an address ie. without an {enter} requirement? Using just one variable for the entire address $gi 7111 93rd Terrace Williamsport, VA 33772-1766 Kats Link to comment Share on other sites More sharing options...
trancexx Posted October 24, 2008 Share Posted October 24, 2008 What if you wanted to clipput an address ie. without an {enter} requirement? Using just one variable for the entire address $gi7111 93rd TerraceWilliamsport, VA33772-1766Use @CRLFbtw, I hate Send() ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
cartman380 Posted October 24, 2008 Share Posted October 24, 2008 What if you wanted to clipput an address ie. without an {enter} requirement? Using just one variable for the entire address $gi 7111 93rd Terrace Williamsport, VA 33772-1766 If you're getting square boxes you might just need to use @CRLF if I understand the question right $gi="7111 93rd Terrace" & @CRLF & "Williamsport, VA" & @CRLF & "33772-1766" Link to comment Share on other sites More sharing options...
komalo Posted October 24, 2008 Share Posted October 24, 2008 also a nice example using spudw2k script to show the fastness of ControlSetText #NoTrayIcon $TestText = "Testing one two three four five six seven eight nine ten" Run("notepad.exe") $hWin = WinGetHandle("Untitled -") WinWaitActive($hWin) $hCtrl = ControlGetHandle($hWin, "", 15) For $i = 1 To 10 $TestText = ControlGetText("Untitled -", "", "Edit1") & $TestText ControlSetText($hWin, "", $hCtrl, $TestText & @CRLF) Next [font="Palatino Linotype"][size="3"]AutoIt Script Examples :[/size][/font][font="Palatino Linotype"][size="3"]_CaptureBehindWindowGlass CMD for Windows Vista/Seven[/size][/font][left][/left][font="Palatino Linotype"][size="3"]Non AutoIt Script programs : Border Skin - Aero Glass On XP[/size][/font] Link to comment Share on other sites More sharing options...
trancexx Posted October 24, 2008 Share Posted October 24, 2008 WinWait() is very important ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
komalo Posted October 24, 2008 Share Posted October 24, 2008 (edited) you are right #NoTrayIcon $TestText = "Testing one two three four five six seven eight nine ten" Run("notepad.exe") WinWaitActive("Untitled -") $hWin = WinGetHandle("Untitled -") $hCtrl = ControlGetHandle($hWin, "", 15) For $i = 1 To 10 $TestText = ControlGetText("Untitled -", "", "Edit1") & $TestText ControlSetText($hWin, "", $hCtrl, $TestText & @CRLF) Next Edited October 24, 2008 by komalo [font="Palatino Linotype"][size="3"]AutoIt Script Examples :[/size][/font][font="Palatino Linotype"][size="3"]_CaptureBehindWindowGlass CMD for Windows Vista/Seven[/size][/font][left][/left][font="Palatino Linotype"][size="3"]Non AutoIt Script programs : Border Skin - Aero Glass On XP[/size][/font] 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