If, Elif, Else? How can I apply conditions in Imacros?

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
Roy Holzem
Posts: 3
Joined: Mon May 26, 2014 6:18 am

If, Elif, Else? How can I apply conditions in Imacros?

Post by Roy Holzem » Fri Jul 11, 2014 3:08 pm

Hello,

I use imacros to input numbers into a db, if the numbers are matching the db shows
a pop up window and my script continues normally (clicks on the number and press ok etc...).

I do have a problem when the db has no entry, which means it cant click on the pop up window
then i do get a timeout error and everything stops. Example Code:

Code: Select all

TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:ManageEventForm ATTR=NAME:itemA.text CONTENT={{!COL1}}
How can I do if, elif, else statements in imacros, or tell imacros to type in "0" if a timeout occurs?


Thank you in advance for any clues or hints on how to resolve this ;)
Roy
chivracq
Posts: 9245
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: If, Elif, Else? How can I apply conditions in Imacros?

Post by chivracq » Fri Jul 11, 2014 4:57 pm

Roy Holzem wrote:Hello,

I use imacros to input numbers into a db, if the numbers are matching the db shows
a pop up window and my script continues normally (clicks on the number and press ok etc...).

I do have a problem when the db has no entry, which means it cant click on the pop up window
then i do get a timeout error and everything stops. Example Code:

Code: Select all

TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:ManageEventForm ATTR=NAME:itemA.text CONTENT={{!COL1}}
How can I do if, elif, else statements in imacros, or tell imacros to type in "0" if a timeout occurs?

Thank you in advance for any clues or hints on how to resolve this ;)
Roy
CIM...! :mrgreen:

Use JavaScript or read this Thread where I explained some Techniques to use in plain .iim Scripts:
- Decision Making using iMacros/Possible Workarounds

Sounds like !ERRORIGNORE and a short(er) !TIMEOUT will achieve what you want...
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
Post Reply