Stable Macro

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
m1405
Newbie
Posts: 4
Joined: Wed Sep 20, 2006 9:13 pm

Stable Macro

Post by m1405 » Thu Sep 21, 2006 3:26 pm

Major problem with other Macro programs I had in the past was to get a macro program running stable (so that it works always and not only in 90% of all trials)

One example I ask for help:
If I want to wait the Macro with processing until a Window is fully loaded I see there's a WaitForWindow command looking on the titles.
But the title is readable before the full window is loaded so I have to wait a bit more. This bit might be 20 seconds if the macro surfs in the Internet.
But I only want to wait the 20 seconds in cases the window is not ready for any actions.
Has someone a little example code sequence for me how to stabilise these kind of situations?

Thanks.

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

Post by Marcus Tettmar » Thu Sep 21, 2006 3:56 pm

In the case of surfing the internet WaitWindowOpen won't help because the browser window is already open and the document may not have finished downloading until after the window title has changed. So for surfing the internet you want to use WebRecorder or script IE via VBScript and IE's COM interface like this:
http://www.mjtnet.com/forum/viewtopic.php?t=1511

This approach lets you monitor IE's Busy property and wait while IE is busy.

For ordinary Windows applications WaitWindowOpen is the best approach but you can also use WaitReady and also set RP_WAIT to 2 prior to the Run Program command. This tells Run Program to wait until the application is ready before continuing afterwards.

We have 10 years of experience making macros with Macro Scheduler which run reliably every day under all sorts of dynamic system environments. It all hinges on finding the best way to determine when a task has completed. There are functions for waiting for pixel colors to change, image recognition functions to wait for an image on the screen, the ability to wait for cursors to change, windows to change size, buttons to change caption, wait for status bar text, etc etc. All these things make it possible to make a 100% reliable macro.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

m1405
Newbie
Posts: 4
Joined: Wed Sep 20, 2006 9:13 pm

Post by m1405 » Thu Sep 21, 2006 4:00 pm

sounds great, will give it a try ...
thanks

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