If macro fails I want it to run a different macro...

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.
Forum rules
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
Alewis
Posts: 1
Joined: Thu Sep 04, 2014 12:44 am

If macro fails I want it to run a different macro...

Post by Alewis » Thu Sep 04, 2014 1:17 am

I am quite new to this but I think it is cool, I currently have this macro;

Code: Select all

VERSION BUILD=8820413 RECORDER=FX
TAB T=1
TAB CLOSEALLOTHERS
URL GOTO=<REMOVED BY ME>
TAG POS=1 TYPE=I ATTR=CLASS:fa<SP>fa-sw<SP>fa-retweet&&TXT:
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:classifieds-form ATTR=ID:button_save
now what this macro does is select a button to bump a classified listing then clicks submit on the next page.
This would work fine however sometimes the listing is gone so it trys to bump it is gets told it can't because it is not on a submit page I get an error

Code: Select all

RuntimeError: element INPUT specified by ID:button_save was not found, line 6 (Error code: -921)
When this happens I want to run a different macro that clicks the button to the left of this twice... I am not sure how to do this.
The button I would have to press would not be in position 1 e.g

Code: Select all

TAG POS=9 TYPE=A ATTR=TITLE:&&DATA-TIP:top&&CLASS:btn<SP>btn-xs<SP>btn-bottom<SP>btn-danger<SP>listing-remove&&DATA-ORIGINAL-TITLE:Remove<SP>this<SP>listing.&&TXT:
TAG POS=1 TYPE=A ATTR=TXT:Click<SP>to<SP>confirm<SP>removal
Now the position can be calculated by either finding the number of listings that can be bummped e.g

Code: Select all

TAG POS=20 TYPE=I ATTR=CLASS:fa<SP>fa-sw<SP>fa-retweet&&TXT:
then minusing the number of trades that can be deleted e.g

Code: Select all

TAG POS=30 TYPE=A ATTR=TITLE:&&DATA-TIP:top&&CLASS:btn<SP>btn-xs<SP>btn-bottom<SP>btn-danger<SP>listing-remove&&DATA-ORIGINAL-TITLE:Remove<SP>this<SP>listing.&&TXT:
That means we should run remove the 10th trade,

So,
How do I get a macro once it fails to run a different macro
How can I get the macro I run to get the number of trades and the number of trades that can be bummped to delete the trade that can't be bumped and run the first macro.

EDIT: Wait, why is there no If, Else If, in this? They would be so easy to implement
Post Reply