Jump to content
Macro Express Forums

hot to make it try again if window doesn’t apear


Recommended Posts

Hello I have a macro that uses the wait for window to appear command and often the window doesn’t ever appear so the macro times out

I need it to just start over if the window doesn’t appear

but I can't find any options on that command for failures

In ME3 you will have to handle this yourself.

Your code will follow this logic:

Repeat until %n1% <> %n1% (i.e. for ever)
 Launch program that opens your target window
 Set %n1% to 0 (just in case this variable has already been set to other than 0)
 Repeat 10 times
If target window is present
  set %n1% = 1
  Repeat exit
  delay 2 seconds
End if
 End repeat
 If %n1% = 1
Repeat exit
 End if
End repeat


- Each "wait for window" set of commands (the inner repeat loop) will wait for up to 20 seconds - you can vary this as you like.

- You need to determine how long to allow the outer loop to run before giving up - follow the same technique as for the inner repeat loop.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...