chandler8 Posted February 23, 2006 Posted February 23, 2006 Hey everyone. I figured out how to get the focus on a window that you want using a handle. Thanks everyone for your input. Tested it out tonight and it works great except if you click on another window the script starts to do things on that window. Oh well expandcollapse popup#include <Array.au3> Func _FileReadToArray($sFilePath, ByRef $aArray) Local $hFile $hFile = FileOpen($sFilePath, 0) If $hFile = -1 Then SetError(1) Return 0 EndIf $aArray = StringSplit(StringStripCR( FileRead($hFile, FileGetSize($sFilePath))), @LF) FileClose($hFile) Return 1 EndFunc;==>_FileReadToArray Local $filePath = @DesktopDir &'\Stocks.txt' Local $aArray = '' _FileReadToArray($filePath, $aArray) Local $sArray = _SeperateEachWord($aArray); should have each 'word' now in an array Sleep(1000) $handle = WinGetHandle("Clearview Pro:") WinWaitActive($handle) For $x = 1 To UBound($sArray) - 1 Sleep(2000) Send($sArray[$x]) WinWaitActive($handle) Send("{Enter}") Sleep(2000) Send("cancel key will fire here") Send("{BackSpace 5}") Next Func _SeperateEachWord(ByRef $aArray, $dDelimeter = ' ') For $i = 1 To Ubound($aArray) - 1 If $aArray[$i] <> '' Then $SplitSpace = StringSplit($aArray[$i], $dDelimeter) For $x = 1 To UBound($SplitSpace) - 1 $sArray = $sArray & $SplitSpace[$x] & Chr(01) Next EndIf Next Return StringSplit(StringTrimRight($sArray, 1), Chr(01)) EndFunc
Moderators SmOke_N Posted February 23, 2006 Moderators Posted February 23, 2006 (edited) Do the input boxes that your sending the information to have ControlID's? If so you could replace Send with ControlSend() Edit: *(sp) Edited February 23, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
chandler8 Posted February 23, 2006 Author Posted February 23, 2006 Do the input boxes that your sending the information to have ControlID's? If so you could replace Send with ControlSend()Edit: *(sp)Thanks for that tip about ControlSend(). I tried it out and it works great. Sorry, if I wasn't clear with what I was trying to describe earlier.
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