Timing a pause

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
GalaxyMan
Junior Coder
Posts: 40
Joined: Sat Jun 27, 2009 7:21 pm

Timing a pause

Post by GalaxyMan » Tue Aug 05, 2014 11:23 am

I use huge databases of 100+ columns and 30,000+ rows. I often need to do a search (with a delete or replace involved). Sometimes it can take almost a minute for the search to complete, sometimes it only takes a few seconds. Is there a method whereby I can move onto the next line of code once the search completes without having to hard-code a fixed interval Wait> that is more than enough for any eventuality, which wastes huge amounts of time, even if it does work.

Thanks in advance.

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

Re: Timing a pause

Post by JRL » Tue Aug 05, 2014 6:10 pm

Timing is everything.

Knowing nothing about the software you're automating we can only offer generic advice. There are many ways to "wait". You simply need to observe your process and decide what Macro Scheduler function will best accommodate the task. For example: If a specific window pops up when the search completes then you might use WaitWindowOpen> or WaitWindowFocused> to detect that window and the script can move on from that moment. Or as another possible example: If a file is created by the search process, maybe you could use a loop that contains IfFileExists> waiting for the moment the file is created and the script can move on from there.

Look at the on-line list of functions. The obvious choices are the functions that start with "Wait..." but also look at the functions that start with :Get..." or "If...". The Get or If functions can be put into a loop to "wait" until a specific identifiable condition is met

Another possibility would be to use the built in database connectivity functions to access or alter your data from within Macro Scheduler.

Hope this is helpful.
Dick

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