The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 895 - File: showthread.php PHP 7.2.34 (Linux)
File Line Function
/showthread.php 895 errorHandler->error




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Wait for Active Window in REP of Macro
#1
Hi, all.

I have an issue that I cannot solve:

I have created a macro (MacroA) that automates some tasks for an application.
That application, at some point, shows up a window that I need to click on one of its buttons.
That window doesn't have a regular show up time. It may vary from a few seconds to a few hours.

I have created another macro (MacroB) to take care of that window showing up, by using:
int w1=wait(0 WA win(....)
and it is working OK.

I need MacroA to run constantly, so I used rep command.

My code looks like this:

{statement}
{statement}
run "C:\MacroB.exe"
int i
i=0
rep
     if(i>9999) break
     out i
     {Look for accessible objects}
     {actions}
     {actions}
     ...
     ...
     i=i+1
     if i>9999
     i=0
#endregion

The problem is that MacroB.exe at some point, irregularly, just stops working. I guess it has to do with timings between actions of both macros.

What I need to know is, how I can incorporate the MacroB functionality inside the repetition area of MacroA, without disrupting rep ?
Is there a way I can use an "if .. then .. else" case to search if the window showing up is active, and if not, rep part of MacroA will continue normally?

Many thanks in advance.


Messages In This Thread
Wait for Active Window in REP of Macro - by e.maliakis - 08-13-2019, 05:29 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)