How can I call Js file within imacro code?

Discussions and Tech Support related to the iMacros Firefox Add-on, including the built-in Javascript scripting interface for playing .js files.
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
green.pine
Posts: 62
Joined: Thu Nov 04, 2010 5:21 pm

How can I call Js file within imacro code?

Post by green.pine » Sat Apr 16, 2011 8:56 am

Hi;
I have a imacro code that start off with a js,
I want to start another iim file before the JS file, then when it finishes the js start to run.

when i put the the following code in the beginning of js file:
retcode = iimPlay("#Current9.iim");

the js call the Current9.iim file but it continues to the read the rest of js file, while the browser still working on the iim file, and this cause some error, the time of play is not constant so I can not put wait command.

how can I make this work?

is there a way to call JS within my imacors file?
this way after running my first imacro file, at the end of code I can call the js file.

thanks
User avatar
Tech Support
Posts: 4948
Joined: Tue Sep 20, 2005 7:25 pm
Contact:

Re: How can I call Js file within imacro code?

Post by Tech Support » Wed Apr 20, 2011 10:17 pm

the js call the Current9.iim file but it continues to the read the rest of js file, while the browser still working on the iim file
Really? That would be a bug. The JS should wait at iimPlay until the macro is completed. => Do you have some test JS file for me?
green.pine
Posts: 62
Joined: Thu Nov 04, 2010 5:21 pm

Re: How can I call Js file within imacro code?

Post by green.pine » Thu Apr 21, 2011 7:00 am

Thanks for reply;
since I am not coder and misses many things, this time also I did not have the complete code in it, after having the following instead of the first line only, then started to work properly:

Code: Select all

retcode = iimPlay("#Current9.iim");
if (retcode < 0)               // an error has occured
   {
      errtext = iimGetLastError();
      alert("3rd Error "+retcode+": "+errtext);
   } 
thanks
Post Reply