Wait for text

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
lebrocoli
Pro Scripter
Posts: 53
Joined: Tue Sep 06, 2005 9:28 pm

Wait for text

Post by lebrocoli » Tue Oct 16, 2007 9:24 pm

Hi,

Is there a command like waitfortext ?

I am trying to wait for the text "x record deleted" before closing the DOS window but I have difficulty doing that.

I have tried getcontroltext and getwindowtext without big success.

Can I use FindWindowWithText ?

Thanks

User avatar
JRL
Automation Wizard
Posts: 3505
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Tue Oct 16, 2007 9:46 pm

Spoke a little on a similar subject here. Assuming this is a DOS program, you might be able to redirect the "x record deleted" message to a file and then detect the existance of the file to know when the process is completed.

Label>WaitingForFile
IfFileExists>c:\path\filename,ThroughWaiting
Wait>1
Goto>WaitingForFile
Label>ThroughWaiting


Before trying that, if this is a DOS program and you are running it from a
Run Program>cmd /c someprogram.exe
line. Set RP_WAIT=1 and the script will automatically stop and wait for the program to finish. The DOS window should close on its own. See help for Run Program>.

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Oct 16, 2007 9:54 pm

I would use WaitScreenImage.

If that sounds confusing, consider that what is on the screen is really just an image. Capture the portion of the DOS screen that displays the text you want to wait for. Assuming it always looks the same you can then use WaitScreenImage. Make the capture as small and specific as possible.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts