Jump to content
Macro Express Forums

Stop/pause Macro When Error Message Pops Up


Recommended Posts


I have been using Macro Express since November and have found answers to many questions in this Forum. Keep up the good work! java script:emoticon(':D')



I have been using Macro Express to "key" data from spreadsheets into the GUI on our new system during the conversion process. This has saved me countless hours and probably carpel tunnel to boot.


Here's my problem. I have not figured out how to stop or pause Macro Express when an error message from the GUI pops up. I thought it would be a "window" command, but the "popups" have the same name as the main window.


I have searched "help" and this forum with no luck. Perhaps I should be looking for a different command, but have no idea what it could be. If someone could point me in the right direction, I would certainly appreciate the help.


Thanks, marteb

Link to comment
Share on other sites

When two or more windows with the same exact title are on your display, it can make it difficult to use Window commands. There are other a couple of options that you can try:

  • Are the error window and GUI window titles exactly the same? Or just the first part?
  • You might be able to distinguish between the two windows using the Get Pixel Color command.
  • You might be able to use the size of the "Window on Top" to determine if an error window popped up.
  • You can try using Window Controls to determine which window is on top.

Link to comment
Share on other sites


Thank you for the information. I won't have a chance to try this until sometime next week. We lost power at work Thursday evening and it had not been restored as of this morning (Saturday). I will let you know if any of these commands solve my problem. Thanks again, marteb

Link to comment
Share on other sites

I think it's very interesting, since I started using Macro Express for much the same reason. The GUI we use here is really horrible, and I found myself doing very repetitive tasks that really could be automated. So I taught myself Macro Express, the macros evolved over time as I got better. I'm using them the same way you are, getting data from a spread sheet (needs to be saved as tab-delimited of course).


My solution is to grab the window you are keying data into as a control, and then whenever you have it enter data first have it wait for that control to gain focus. Here's what I did:


When the window you're entering comes up:


Capture Control to %C1%

(control focused)


Then whenever you enter something:

Wait for Control

(%C1%, gain focus)


I also have it

Set Focus to %C1%

when entering, just to be sure that it's always in the proper window (on a computer other windows can sometimes pop up, and you don't want a macro running wild)


Hope that helps. (BTW, is there a way to copy and paste Macro code?)

Link to comment
Share on other sites

  • 4 weeks later...

Hello Joe and another1one,


I have finally had time to research and play with the window control functions. I had been using Activate Window with delays built in to give the system time to respond. I like the window control much better, which brings up a few questions.


1) Am I understanding correctly that the Get Control command defines each control variable? If so, can you define all controls at the beginning of a macro?


2) By using the "Wait for Control" & "Set Focus" commands can I eliminate adding a delay between commands?


Thanks for the help,



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...