brockaf Posted February 20, 2006 Posted February 20, 2006 (edited) Hello; I'm having a bit of a problem here. I wrote an AutoIT script that reads a text file and posts the data into specific fields into application GUI(Meditech). This is the only way to update a Meditech screen. See code below. The script works wonderfully but my problen is: if the user brings another window up say "UltraEdit", the script passed control off to Ultra Edit and pumps the data into it rather than the Meditech screen. Question How do I insure that the scripts only enters the data into Meditech and not another? Control Send hangs on me. GetWindowHandle looks great but when I run "AutoIT WIndow Info" there at times Window text and some time no window text . TIA Allan some code below Func GetCurrentWin (ByRef $WindowTitle, $WindowText) WinWait($WindowTitle, $WindowText) If Not WinActive($WindowTitle, $WindowText) Then WinActivate($WindowTitle, $WindowText) WinWaitActive($WindowTitle, $WindowText) EndFunc ;==>GetCurrentWin . . . $WindowTitle = "Meditech Health Care Information System" $WindowText = "Batch Enter/Edit" $Comment = "Acct#:" & StringMid($LINE, 32, 12) & " Loc: " & StringStripWS(StringMid($LINE, 10, 10), 3) GetCurrentWin ($WindowTitle, $WindowText) Send($Comment & "{ENTER}"); -<---- Comment Line Edited February 20, 2006 by brockaf
Valuater Posted February 20, 2006 Posted February 20, 2006 Replace theis Send($Comment & "{ENTER}"); -<---- Comment Line with ControlSend(title,text,control,string) ; see help and the control ID can be gotten with au3info.exe in your autoit3 folder 8)
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