Fractured Posted August 17, 2018 Share Posted August 17, 2018 (edited) Ok..so ive got my proggy almost done. Now the only problem is I have an EditBox being used as a Console Window, so that while im testing I can see the data returned from the Unit. The data is appened to last line in the edit Box, and it can make for a long string. At the end of testing I have a Send to File button, so that I can see all that was done during the testing... So this is the code I have... Func _OutFile() $TempEdit = GUICtrlRead($Edit1) $OutEdit = StringReplace($TempEdit, @LF, "") Run("notepad.exe") WinWaitActive("Untitled - Notepad") Sleep(1000) ;Send("Untitled - Notepad", "", "Edit1", $OutEdit) Send($OutEdit) EndFunc Problem is, when it sends the code to notepad, its slow like im typing it character by character. Is there a faster way to send the data to Notepad? Ive scanned the forum and tried some different variations, but still cant seem to speed things up! Thanks in advance! P.S. I would just write to file but the save space is different depending on the test station im at. Edited August 17, 2018 by Fractured Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted August 18, 2018 Share Posted August 18, 2018 @Fractured Send is used to simulate user interactions, so, it is almost "normal" that is not so fast. You could use File* functions, to create a file, open it, write into it, close it, and run it in order to see it's content ( without reading it in a variable ). I think that this should be faster than using Send command Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Fin Posted August 18, 2018 Share Posted August 18, 2018 You can remove the delay on 'send' by adding this line to your function: Opt("SendKeyDelay",0) Link to comment Share on other sites More sharing options...
Bowmore Posted August 19, 2018 Share Posted August 19, 2018 ContolSetText is another quick option Func _OutFile() $TempEdit = GUICtrlRead($Edit1) $OutEdit = StringReplace($TempEdit, @LF, "") Run("notepad.exe") WinWaitActive("Untitled - Notepad") Sleep(1000) ControlSetText("Untitled - Notepad", "", "Edit1", $OutEdit) EndFunc Fin and Fractured 2 "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook Link to comment Share on other sites More sharing options...
Fin Posted August 19, 2018 Share Posted August 19, 2018 Good one @Bowmore. That's what I was trying to think of yesterday but kept coming up with GUICtrlSetData for some reason lol. @Fractured should use your code for sure...:) Link to comment Share on other sites More sharing options...
Fractured Posted August 20, 2018 Author Share Posted August 20, 2018 Thanks all! Ill be attempting to implement @Bowmore's code in!! Thanks for all the input folks!! Love this place!! 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