Closing a window that maybe does not exists

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Fq

Closing a window that maybe does not exists

Post by Fq » Thu Nov 21, 2002 5:13 pm

If I use CloseWindow and the program does not find the window give a error message.
Can I do something so that this error message does not appear and the script goes on running?

The new varibale RP_WAIT, what does it do exactly? Wait till all the tasks are done? Or only some of them?

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

Post by Marcus Tettmar » Thu Nov 21, 2002 5:40 pm

Hi,

Before doing your CloseWindow check first that the window is present with IfWindowOpen.

IfWindowOpen>MyWindow,CloseIt
Goto>Closed
Label>CloseIt
CloseWindow>MyWindow
Label>Closed

RP_WAIT tells the Run Program (Run) command to wait until the application/command/program it has invoked has terminated before allowing the script to proceed.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

FQ

Post by FQ » Fri Nov 22, 2002 12:10 am

What do you mean when you say "terminated"?
Does it need that the aplication had been closed?
Please, tell me some examples.

Ernest

Post by Ernest » Fri Nov 22, 2002 8:15 am

Yes.

Sample:

Code: Select all

Let>RP_WAIT=1
Run Program>cmd /c dir c:\*.* > c:\dirlist.txt
ExecuteFile>c:\dirlist.txt
will run a DOSBox (under NT) which close automatically, piping a dir list of c:drive to a file. Execution off output file will be delayed till writing has finished. You won't get a sharing violation!

E.

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