[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++.

Moderators: Community Moderators, iMacros Moderators

Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

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

by antony268082 on Tue May 23, 2017 11:34 pm

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
antony268082
 
Posts: 2
Joined: Tue May 23, 2017 11:28 pm

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

by chivracq on Wed May 24, 2017 2: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)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6474
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

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

by antony268082 on Wed May 24, 2017 7:23 am

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
antony268082
 
Posts: 2
Joined: Tue May 23, 2017 11:28 pm

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

by chivracq on Wed May 24, 2017 8:21 am

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)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6474
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)


Return to Scripting and Command Line Interface

Who is online

Users browsing this forum: Bing [Bot] and 5 guests

-->