oMBRa Posted August 23, 2008 Share Posted August 23, 2008 Send() sends simulated keystrokes kinda slowly... how to do it very quickly? Link to comment Share on other sites More sharing options...
TehWhale Posted August 23, 2008 Share Posted August 23, 2008 Opt("SendKeyDelay") Link to comment Share on other sites More sharing options...
oMBRa Posted August 23, 2008 Author Share Posted August 23, 2008 I already used it but still slow... I want a speed like when u do Ctrl + V to paste some text Link to comment Share on other sites More sharing options...
Nahuel Posted August 23, 2008 Share Posted August 23, 2008 That depends on what exactly you are trying to do. Here's an example of an alternative way:$text="This is a pretty long text that should appear in notepad really fast" Run("notepad.exe") WinWait("[Class:Notepad]") ControlSetText("[Class:Notepad]","","[CLASS:Edit; INSTANCE:1]",$text) Link to comment Share on other sites More sharing options...
dgarrett8 Posted August 23, 2008 Share Posted August 23, 2008 You personally think it's? I think it's fast as hell. "I think, therefore I am"[size="1"]René Descartes[/size] Link to comment Share on other sites More sharing options...
Nahuel Posted August 23, 2008 Share Posted August 23, 2008 You personally think it's? I think it's fast as hell.I think so too, but he wants the text to "appear" just like it does when you paste text on an editor. Link to comment Share on other sites More sharing options...
dgarrett8 Posted August 23, 2008 Share Posted August 23, 2008 I don't think that is possible..maybe I'm wrong "I think, therefore I am"[size="1"]René Descartes[/size] Link to comment Share on other sites More sharing options...
Nahuel Posted August 23, 2008 Share Posted August 23, 2008 (edited) I don't think that is possible..maybe I'm wrongClick me Edited August 23, 2008 by Nahuel Link to comment Share on other sites More sharing options...
burners Posted August 24, 2008 Share Posted August 24, 2008 AutoItSetOption("SendKeyDelay", 1) AutoItSetOption("SendKeyDownDelay", 1) ~~--Feel Free to Steal my Sigs --~~FLAT LOOK____________________________________ROUNDED LOOK Link to comment Share on other sites More sharing options...
herewasplato Posted August 24, 2008 Share Posted August 24, 2008 ... I want a speed like when u do Ctrl + V to paste some textThe sample code posted by Nahuel should work for you unless your app (like some apps I work with) ignores* ControlSetText. In that case, use ClipPut("text") and ControlSend("^v") [or if you must - just use Send("^v")] ClipPut("This is a pretty long text that should appear in notepad really fast") Run("notepad.exe") WinWait("[Class:Notepad]") ControlSend("[Class:Notepad]","","[CLASS:Edit; INSTANCE:1]", "^v") Sleep(1500) WinClose("[Class:Notepad]")oÝ÷ ØKÞÚ-z èë-ë^ÆÛ§¶)r¢ë½ëayø¥xò¢èî²×%¢Çì"Ú06^¥§pYg¢Úk¢jmʢƯy©òµìmªê-±éíªê-¶¾&¢{k¢Tµ7±µ«¢+ØÀÌØíÑáÐôÅÕ½ÐíQ¡¥Ì¥ÌÁÉÑÑä±½¹ÑáÐÑ¡ÐÍ¡½Õ±ÁÁÈ¥¸¹½ÑÁɱ±äÍÐÅÕ½Ðì)IÕ¸ ÅÕ½Ðí¹½ÑÁ¹áÅÕ½Ðì¤)]¥¹]¥Ð ÅÕ½Ðím ±ÍÌé9½ÑÁtÅÕ½Ðì¤) ½¹Ñɽ±MÑQáÐ ÅÕ½Ðím ±ÍÌé9½ÑÁtÅÕ½Ðì°ÅÕ½ÐìÅÕ½Ðì°ÅÕ½Ðím 1MLé¥Ðì%9MQ9 èÅtÅÕ½Ðì°ÀÌØíÑáФ)M±À ÄÔÀÀ¤)]¥¹ ±½Í ÅÕ½Ðím ±ÍÌé9½ÑÁtÅÕ½Ðì [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
herewasplato Posted August 24, 2008 Share Posted August 24, 2008 AutoItSetOption("SendKeyDelay", 1) AutoItSetOption("SendKeyDownDelay", 1)Welcome to the forum. It would depend on the volume of data being sent as to the speed delta between the fastest Send and the other methods. Try this code. AutoItSetOption("SendKeyDelay", 1) AutoItSetOption("SendKeyDownDelay", 1) Dim $t For $i = 1 To 500 $t &= String($i) Next Run("notepad.exe") WinWait("[Class:Notepad]") Send("Send " & $t) Sleep(1000) ControlSend("[Class:Notepad]", "", "[CLASS:Edit; INSTANCE:1]", "^a{BS}") Sleep(1000) ClipPut($t) Sleep(50) ControlSend("[Class:Notepad]", "", "[CLASS:Edit; INSTANCE:1]", "Paste " & "^v") Sleep(2000) ControlSend("[Class:Notepad]", "", "[CLASS:Edit; INSTANCE:1]", "^a{BS}") Sleep(1000) ControlSetText("[Class:Notepad]", "", "[CLASS:Edit; INSTANCE:1]", "ControlSetText " & $t) Sleep(2000) WinClose("[Class:Notepad]") @oMBra, You can overwhelm the Windows clipboard if you repeatedly transfer data to and from it as fast as AutoIt can. The OS clipboard may fail you at max speed... It would be best to use a Sleep of about 50 or a 100 ms between each repeated clipboard operation. [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
oMBRa Posted August 24, 2008 Author Share Posted August 24, 2008 I already use clipboard but some letter can't be copied like "" and I cant use ControlSetText because the window isnt a windows application so I cant get the ID of the control Link to comment Share on other sites More sharing options...
herewasplato Posted August 24, 2008 Share Posted August 24, 2008 I already use clipboard but some letter can't be copied like "" ...So you are left with using AutoItSetOption("SendKeyDelay", 1) AutoItSetOption("SendKeyDownDelay", 1) Send("^v" & "")* or whatever it takes to send "" [size="1"][font="Arial"].[u].[/u][/font][/size] 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