jphillips2 Posted September 13, 2007 Share Posted September 13, 2007 I need a little help, I am writing a script that when you push a key text auto populates in the active field. Is there any way to speed up the text on the out put. Right now is seems slow since it looks like someone is typing it. Thanks in advance for the help Jake Link to comment Share on other sites More sharing options...
_Kurt Posted September 13, 2007 Share Posted September 13, 2007 Try: Opt("SendKeyDelay",1)oÝ÷ ØêÚºÚ"µÍÌÍÜÙ[Ý[ÈH ][ÝÝÝ ][ÝÂÌÍÙÙ]HÛÙ] BÛ] ÌÍÜÙ[Ý[ÊBÙ[ ][Ý×][ÝÊBÛ] ÌÍÙÙ] oÝ÷ ØêÚºÚ"µÍÛÛÛÙ[ ÛÚÈ[H[[HÜÜ[Y]È Kurt Awaiting Diablo III.. Link to comment Share on other sites More sharing options...
_Kurt Posted September 13, 2007 Share Posted September 13, 2007 The second option is not supposed to be there, and whenever I try to edit my post it modifies the examples in my [.autoit] tags. Awaiting Diablo III.. Link to comment Share on other sites More sharing options...
herewasplato Posted September 13, 2007 Share Posted September 13, 2007 ...and then there is ControlSetText() [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
jphillips2 Posted September 13, 2007 Author Share Posted September 13, 2007 ...and then there is ControlSetText()Ok can you give me a example of where to use it. Here is my code.Global $PausedHotKeySet("{PAUSE}", "TogglePause")HotKeySet("{ESC}", "Terminate")HotKeySet("{f1}","ShowMessage") While 1 Sleep(100)WEnd;;;;;;;;Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',0,0) WEnd ToolTip("")EndFuncFunc Terminate() Exit 0EndFuncFunc ShowMessage() send ("Site(s):{Enter}Issues:{Enter}Ownership:{enter}Agents:{enter}TP Incident:{Enter}Ext Ticket:",1) EndFunc Link to comment Share on other sites More sharing options...
herewasplato Posted September 13, 2007 Share Posted September 13, 2007 (edited) If the application that you are sending this info to is inside of a web browser like Internet Explorer, then the Control functions like ControlSetText may not work. In order for us to help you write the proper code for your needs: Please open the AutoIt Window Info tool Click on the control (field) of interest Press Ctrl-Alt-F to freeze the data in the AutoIt Window Info tool then copy/paste/post the info from the "Summary tab" of that tool for the Control Section - like this: >>>> Control <<<< Class: SysListView32 Instance: 1 ClassnameNN: SysListView321 As far as where to place the ControlSetText line in your script, it will replace the "Send" line in your code. The Control... functions are the best to use, but not all applications respond to them. For now (like _Kurt mentioned), add this as the first line of your script: Opt("SendKeyDelay",1) and see if that is fast enough for you. Edit: I do not think that you want the ", 1" at the end of your send line. Edited September 13, 2007 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
crash748 Posted September 13, 2007 Share Posted September 13, 2007 You can add both Opt("SendKeyDelay", 0) and Opt("SendKeydownDelay", 0)Maybe you will get a better result! Link to comment Share on other sites More sharing options...
jphillips2 Posted September 13, 2007 Author Share Posted September 13, 2007 You can add both Opt("SendKeyDelay", 0) and Opt("SendKeydownDelay", 0)Maybe you will get a better result!They way I am trying to have this work is to send the preset text to a active window including IE and Firefox. I am trying to make it look like it is not being typed. is there anyway to do that? Link to comment Share on other sites More sharing options...
dbzfanatic Posted September 13, 2007 Share Posted September 13, 2007 Not that I know of because in effect it IS being typed just at an incredible rate. Plus there is no firefox support in autoit, not directly, so the coding may not work correctly or at all if you try to do it this way. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
crash748 Posted September 13, 2007 Share Posted September 13, 2007 They way I am trying to have this work is to send the preset text to a active window including IE and Firefox. I am trying to make it look like it is not being typed. is there anyway to do that?Like Kurt said the clipboard can be an alternative Func ShowMessage() $OldClip = ClipGet() ClipPut("Site(s):" & @CRLF & "Issues:" & @CRLF & "Ownership:" & @CRLF & "Agents:" & @CRLF & "TP Incident:" & @CRLF & "Ext Ticket:") Send("^V") ClipPut($OldClip) EndFunc ;==>ShowMessage Link to comment Share on other sites More sharing options...
ssubirias3 Posted September 13, 2007 Share Posted September 13, 2007 (edited) I need a little help, I am writing a script that when you push a key text auto populates in the active field. Is there any way to speed up the text on the out put. Right now is seems slow since it looks like someone is typing it. Thanks in advance for the help JakeI've played and tested all of these suggestion in the past and the one I've come to love is Kurt's suggestion of pasting from the clipboard. You can really see the difference in speed in long strings, even if you use Opt("SendKeyDelay", 1). The Help file warns about using 0 and I can't really see a difference between 0 and 1. With ControlSetText, that too can be tricky as mentioned in the Help Remarks section. When ControlSetText() works its a close second to Send("^v"), imo. One last point, if you are pasting to multiple fields and you use Opt("SendKeyDelay", 1), you may want or need to slow it down just a bit to work flawlessly. Kurt's on the money though for sure with a slight modification. $LongMsg1 = "whateveryoulittleheartwantstoputhere" $LongMsg2 = "whateveryoulittleheartwantstoputhere" $LongMsg3 = "whateveryoulittleheartwantstoputhere" ClipPut($LongMsg1) ;; puts $LongMsg1 into clipboard memory like CTRL+C Sleep(100) Send("^v") ClipPut($LongMsg2) Sleep(100) Send("^v") ClipPut($LongMsg3) Sleep(100) Send("^v") ;; or you can loop it too For $i = 1 To 3 ;; loop 3 times ClipPut($LongMsg & $i) Sleep(100) Send("^v") Next ClipGet() is used to set a variable like Kurt's $get equal to what's in the clipboard buffer. Hope this helps and good luck! Edited September 13, 2007 by ssubirias3 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