ejs Posted October 1, 2007 Report Share Posted October 1, 2007 How can I set up a macro so that if it encounters an error in the middle of the script, the macro will continue at the next command in the script rather than aborting? I've tried using the "log errors" command, but that only suppresses of the error message dialog box; the macro still aborts. Specifically, I want to use the 'wait for web page to load' command, and I have the maximum wait time set to 10 seconds. If the web page does not load in ten seconds, the wait for web page command aborts the macro. But I really want the macro to continue at the next command in the script after ten seconds regardless of whether the web page has completed loading or not. I can't simply replace the wait for web page command with a 10 second delay command, because then the user will always be waiting a full 10 seconds every time, even though the web page normally loads in one second. Also, I would like to applied this "ignore error and continue" behavior only to specific macros. I don't want to select a systemwide option that would make this happen to all my macros. Quote Link to comment Share on other sites More sharing options...
Cory Posted October 1, 2007 Report Share Posted October 1, 2007 As far as I know there is no way. In the future this will change but for now we have to deal with it. How I approach the problem is to instead of letting the timeout happen I will do a 10X repeat with a 1 second delay. In that repeat I will test the top window to see if it meets my criteria. This way I can in effect get the error handling I want. Quote Link to comment Share on other sites More sharing options...
Cory Posted October 1, 2007 Report Share Posted October 1, 2007 An idea I had and have played with a little is to make my own error handling. I create ‘markers’ where I write something to the registry like “waitfor23” for my twenty-third wait command right before it starts waiting. Then when it’s done waiting wipe out the registry value. At the beginning of the macro I can enable another macro like “error handler” which is set to run on a schedule. At the end of the macro I disable the error handler macro. So if nothing errors all if fine. But if it does error out and the user cancels the macro then the error handler macro is still enabled and will run. It will use that registry value to somehow jump back to that point in the macro or do something else. Crude, but it works. Quote Link to comment Share on other sites More sharing options...
gharol Posted June 4, 2008 Report Share Posted June 4, 2008 Cory, That's very interesting and creative. But can you help with the mechanics? How to put a marker etc. I am not aware of a command that will enable jumping to a specific marker inside a macro. I suppose all variables must be backed up to the registry or environment variables? Do you have an example you can send. An idea I had and have played with a little is to make my own error handling. I create ‘markers’ where I write something to the registry like “waitfor23” for my twenty-third wait command right before it starts waiting. Then when it’s done waiting wipe out the registry value. At the beginning of the macro I can enable another macro like “error handler” which is set to run on a schedule. At the end of the macro I disable the error handler macro. So if nothing errors all if fine. But if it does error out and the user cancels the macro then the error handler macro is still enabled and will run. It will use that registry value to somehow jump back to that point in the macro or do something else. Crude, but it works. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.