Jump to content
Macro Express Forums

Pause Macro


Recommended Posts

Hello everyone,

 

I have a macro script at work that is about 225 lines that did not take into account a way to have the macro pause if another window title interrupted the macro.

 

Does anyone have an idea as to how to insert a single macro command that would pause the script no matter where it is in the script so that it could resume after the unwanted window title disappears? This could be any window title that is not taken into account in the script.

 

Thanks!

 

Pat

Link to comment
Share on other sites

I've had this problem before and the only solution I could find was to constantly check that the proper window was focused or better yet continually refocus the window. This is one reason I like to do all my processing in variable land. EG grab the entire Excel table and processes in memory, build an entire output table and then paste back in ans one big chunk. Also using a Virtual Machine is good for things like this so you can have a controlled uninterrupted environment.

 

 

Link to comment
Share on other sites

Fair enough, however you cannot get fully automated with Macro Express because you cannot send literal clicks, hotkeys etc. to a hidden/minimized window. So in a macro that is dependent on situations like this, we are out of luck unless we use Autohotkey.

 

For instance, if I have a minimized program or internet explorer, the only way to process this is to have the program focused/activated. If I wanted to send an ALT+N to a minimized Outlook program(mind you I know you could open new Outlook message in other ways- this is just an example), you can't do it unless the window is at least visible.

 

There is nothing regarding ME and Internet explorer except Tabbing through the webpage. Javascript works, but ME all by itself doesn't. Autohotkey works with Javascript in its own langaugae, but Macro Express does not all by itself. You cannot send a pointer click to the webpage unless one does a riduclous amount of tabbing through the webpage.

 

Pat

Link to comment
Share on other sites

If you read my other posts you will see I have been opting to use the IE API instead of MEP for the more complex automation. Fairly simple to do with VBScript and that can be controlled thru with the External Script command.

Link to comment
Share on other sites

  • 2 weeks later...

I really wish there there was a magic bullet that if anything interrupts the progression of the script that the macro would pause and after a designated time, resume what it was doing.

Nope. Read some of my other posts regarding this. When I write big automation macros i navigate to the web page. I check some text on the page to make sure I'm at the right place, I enter the data, I copy the data back and compare it was put in correct, then I submit the form, then I copy the results or go to another page to verify again the post was successful, then log result and start all over again. Then of course at each stage I have a recovery algorithm that will recover if anything goes wrong. Hundreds of lines of code. But the API has made this an order of magnitude faster, simpler, and more reliable.
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.

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

Loading...
 Share

×
×
  • Create New...