help with simple exception handling

Discussions and Tech Support specific to the iMacros Firefox add-on.
Forum rules
iMacros EOL - Attention!

The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.

Thank you again for your business and support.

Sincerely,
The Progress Team

Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
jericko
Posts: 8
Joined: Tue Nov 30, 2010 4:08 pm

help with simple exception handling

Post by jericko » Tue Nov 30, 2010 4:55 pm

I recorded a simple macro that follows my clicks. After several loops I get some errors with buttons that I want to handle.

1. for some reason even if the button shows up on the screen the macro errors and says the button is not there
2. in some screens in same cases a button may not exist in that case.

I really just want some simple exception handling. I run this out of a loop.

1. how do i trap for exceptions? Is there an exception clause I put at the bottom of the script?
2. how do i trap an exception on a specific message? for example, I would want to try different things depending on the button that is missing.

Basically i want to do a few simple things to "reset" what I was doing, finish the script and have the loop re-executive. This is not fancy.
Tom, Tech Support
Posts: 3834
Joined: Mon May 31, 2010 4:59 pm

Re: help with simple exception handling

Post by Tom, Tech Support » Wed Dec 01, 2010 3:50 pm

Hi jericko,

If you call your macro using the built-in Javascript scripting interface then you can check the return codes and handle errors accordingly. You can also use Javascript's exception handling with try/catch blocks. Take a look at this script I just posted to get an idea.
Regards,

Tom, iMacros Support
Post Reply