bigred Posted September 7, 2004 Share Posted September 7, 2004 Is there any way to have the text being sent by the send command to appear instantly? I need it to work the same way the ControlSetText and ControlCommand(EditPaste) work, in the way that the text appears instantly in the edit field.Any ideas? Or would this need to be implemented by the Devs? Link to comment Share on other sites More sharing options...
ezzetabi Posted September 7, 2004 Share Posted September 7, 2004 What about using ControlSetText as you already said? You can't have the same effect with Send()... If you are really really stuck you may try Autoit2 that could. Link to comment Share on other sites More sharing options...
sugi Posted September 7, 2004 Share Posted September 7, 2004 Send cannot instantly send different keys. Same as when you try to enter text on your keyboard. If you'd press all keys for one word you'll just have character jam and not the text you wanted. So Send basically does the same as you: pressing one key after the other. If you need to show some text instantly, you could try working with the clipboard. Copy the text to clipboard and then paste it. Link to comment Share on other sites More sharing options...
Administrators Jon Posted September 7, 2004 Administrators Share Posted September 7, 2004 Have the sendkeydelay and keydowndelay set to -1. That is the quickest that send will work but then you might have reliability issues. Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
bigred Posted September 7, 2004 Author Share Posted September 7, 2004 (edited) What about using ControlSetText as you already said? You can't have the same effect with Send()... If you are really really stuck you may try Autoit2 that could. <{POST_SNAPBACK}>I need to send variables in the text string and so far I haven't found a way to encapsulate them into a ControlSetText or ControlCommand(EditPaste) string. I could use EditPaste a bunch of times but that would not be practical in this case. Check out post #9 in this thread for an explanation. http://www.autoitscript.com/forum/index.php?showtopic=4646 EDIT: Err nevermind I think JdeB has solved the issue of using ControlSend. Send cannot instantly send different keys. Same as when you try to enter text on your keyboard. If you'd press all keys for one word you'll just have character jam and not the text you wanted. So Send basically does the same as you: pressing one key after the other. If you need to show some text instantly, you could try working with the clipboard. Copy the text to clipboard and then paste it. <{POST_SNAPBACK}>True, but the other text send commands can do it, why not this one? I just need a command that will let me send text instantly with encapsulated variables. Oh and it has to be as reliable as possible. Well I need to encapsulate variables in the string. How could I do that prior to putting it in the clipboard? Have the sendkeydelay and keydowndelay set to -1. That is the quickest that send will work but then you might have reliability issues. <{POST_SNAPBACK}>Ahh that worked pretty well. What sort of reliability issues might I face? What would the cause be, and is there a way to help prevent them without upping the delays? Edited September 7, 2004 by bigred Link to comment Share on other sites More sharing options...
Administrators Jon Posted September 7, 2004 Administrators Share Posted September 7, 2004 (edited) $var = "hello" $var2 = "again" ControlSetText("win", "title", "Edit1", "this is some text along with vars " & $var & $var2) Edited September 7, 2004 by Jon Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
bigred Posted September 7, 2004 Author Share Posted September 7, 2004 That works! Thanks! Wow there are so many ways to do one thing its rather confusing. From the help file I didn't know you could do the & whatever thing like with Send. Link to comment Share on other sites More sharing options...
sugi Posted September 8, 2004 Share Posted September 8, 2004 (edited) True, but the other text send commands can do it, why not this one? I just need a command that will let me send text instantly with encapsulated variables. Oh and it has to be as reliable as possible. I'm not really sure about this but here's what I think: ControlSend does not simulate keypresses. So it does not have the drawback of simulating to press the key down, then release the first key, press the next key down, release the second key...Instead it simply tells windows: "Send the following keys to the specified control". Edited September 8, 2004 by sugi Link to comment Share on other sites More sharing options...
Administrators Jon Posted September 8, 2004 Administrators Share Posted September 8, 2004 I'm not really sure about this but here's what I think: ControlSend does not simulate keypresses. So it does not have the drawback of simulating to press the key down, then release the first key, press the next key down, release the second key... Instead it simply tells windows: "Send the following keys to the specified control". Send() is a very low level function that simulates the actual keypresses on the keyboard. Eventually windows turns these keypresses into windows messages that it sends to the message queue of a window ControlSend() creates and sends the windows messages directly to a windows message queue (key up/key down type messages) ControlSetText() Just sends a single "change your text to this" message The fewer messages sent, the less chance of things going wrong. Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/ 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