[HELP] Don't know how to try again js code if error occurs

Discussions and Tech Support related to automating the iMacros Browser or Internet Explorer from any scripting and programming language, such as VBS (WSH), VBA, VB, Perl, Delphi, C# or C++.
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
antony268082
Posts: 2
Joined: Wed May 24, 2017 6:28 am

[HELP] Don't know how to try again js code if error occurs

Post by antony268082 » Wed May 24, 2017 6:34 am

Hello, is there any way to do again javascript code if an error occurs? my website sometimes lag. Thank you!
Imacros 8.9.7
Win 7 64bit
Firefox 50
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: [HELP] Don't know how to try again js code if error occu

Post by chivracq » Wed May 24, 2017 9:36 am

antony268082 wrote:Hello, is there any way to do again javascript code if an error occurs? my website sometimes lag. Thank you!

Code: Select all

Imacros 8.9.7
Win 7 64bit
Firefox 50
FYI, v8.9.7 for FF still works on FF53, in case you are "afraid" of updating FF to FF53 if v8.9.7 would stop working in this Version, ah-ah...!

Well, about your Qt, one of the main Reasons for using a '.js' Script (versus an '.iim' Script) is to be able to check the Return Code of your '.iim' Script when you play it with 'iimPlay()' and to take any Conditional Action based on it like to re-run your Macro if RetCode <> 1 for example in your Case.

Have a look at all Return Codes in the Wiki. (The Page can easily be found from the 'Command Reference'...)

Mini-Remark: The 'Scripting Interface' Sub-Forum is meant for Cases using the Scripting Interface with other Programming Languages than JavaScript in FF, like VB or C# for example... Threads about a '.js' Script using the Built-in JS Engine in FF do not use the Scripting Interface and belong to the 'iMacros for FF' Sub-Forum... (But no need to duplicate...)
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
antony268082
Posts: 2
Joined: Wed May 24, 2017 6:28 am

Re: [HELP] Don't know how to try again js code if error occu

Post by antony268082 » Wed May 24, 2017 2:23 pm

I did it. I used while(iimPlay(load)<0){} and it repeats the code until there is no error. Thank you for your support :D
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: [HELP] Don't know how to try again js code if error occu

Post by chivracq » Wed May 24, 2017 3:21 pm

antony268082 wrote:I did it. I used

Code: Select all

while(iimPlay(load)<0){}
and it repeats the code until there is no error. Thank you for your support :D
Yep, very good...! Excellent...! :D
OK, glad I could help... 8)
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
Post Reply