JailDoctor Posted July 9, 2012 Posted July 9, 2012 (edited) I wrote a routine that collects data from window by double-clicking a specific address and copying the selection to the clipboard. The cliboard contents then go to an array as a new element. I need a way to send the selection directly to the array without copying it to the clipboard (to save resources). $text = WinGetText("[MyWindow]", "") does not work because the window is from a legacy database run in a mainframe. Here is a sample of my code: ; move and size the window WinMove("MyWindow", "", Default, Default, 800, 500) MouseClick("", 489, 129, 2) ; Copy the selected text Send("{CTRLDOWN}{INS}{CTRLUP}") $XLArrayMyText = (_ClipBoard_GetData()) I would like to get rid of the last two lines and make the selection an array element without copying it into the clipboard. I have not found this topic in the forum. Thank you. Edited July 9, 2012 by JailDoctor
DicatoroftheUSA Posted July 9, 2012 Posted July 9, 2012 We run a couple different versions of mainframe emulators where I work, Each has a function to copy screen contents to a string, you might want to double check yours. That is a lot more reliable than send keys. Statism is violence, Taxation is theft. Autoit Wiki
JailDoctor Posted July 10, 2012 Author Posted July 10, 2012 Yes, that is why I want to be able to convert a selection (by double clicking the mouse in a spot) into an array. WinGetText does not work. How do you copy the screen contents?
DicatoroftheUSA Posted July 10, 2012 Posted July 10, 2012 It depends on the emulator, but I have never seen one that does not have a Hotkey to capture the screen to text, or a OLE Automation Interface. It should be in the help file. I don't know what you mean by saving resources, as a screens worth of text uses negligible resources, much less the AI script itself. If the issue is loosing the users clipboard data, you can do something like. $hClipBackup=clipget() DoYourThingThatMessesUpClipboard() clippug($hClipBackup) Statism is violence, Taxation is theft. Autoit Wiki
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