Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: process control sendkey wait pacing problem
The options for creating a pause or delay are:
Things you can check for: files that exist, windows, dialog boxes, system resource percents etc. What does it do? Make a file on disk (FileExist)? Update a file (FileTimeCode)? Make any registry entries (regqueryvalue)?
ret = WinWaitExist("~Notepad", 10) if ret == 0 Message("Notice", "The window was not found") Exit endif
Or heres an example of a while loop checking for a window title:
while WinExist("~Notepad") timedelay(2) endwhileor to check for the window when it closes:
while ! WinExist("~Notepad") timedelay(2) endwhileFor example, a dialog box may be displayed when printing is in progress. Write a loop in the script which checks for the existence of the dialog box. When the dialog box closes, the script will continue.
The idea is to figure out some way of telling when an application is done. Does anything on the screen change. Did some file suddenly appear? You need something you can get your hands on. For example:
WinWaitExist("Done") ;or maybe WinWaitChild("MS Access","Done")or, something like:
while WinExist("Notepad") delay(2) endwhile
fname="c:\xxx\output.txt" while !FileExist(fname) TimeDelay(1) endwhile while FileSize(fname)==0 TImeDelay(1) endwhile
This handy script helps you see what is going on, in terms of parent and child window names:
parents=WinItemize() thisone=AskItemList("Choose a Parent Window",parents,@tab,@sorted,@single) children=WinItemChild(thisone) child=AskItemList("Children of %thisone%",children,@tab,@sorted,@single)The WinItemChild() along with a strindex might be most helpful.
Article ID: W13824
Filename: How to Make SendKey Wait .txt
File Created: 2008:04:10:14:34:40
Last Updated: 2008:04:10:14:34:40