Help with !var/!loop
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
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
Help with !var/!loop
Hello, it is very late where I am and this is my first post.
I will try not to break any rules, but no promises.
I am having an issue that I can't seem to find a cure for.
I would like to be able to control an if function, however, I'm not sure if iMacros for Firefox supports this.
If what I have previously state is true then is there a way for the script to determine the amount of loops it has ran? Or a way to set a !VAR to count the amount of loops then do something?
As I have said before I am having a little bit of trouble and the help would be greatly appreciated.
I will try not to break any rules, but no promises.
I am having an issue that I can't seem to find a cure for.
I would like to be able to control an if function, however, I'm not sure if iMacros for Firefox supports this.
If what I have previously state is true then is there a way for the script to determine the amount of loops it has ran? Or a way to set a !VAR to count the amount of loops then do something?
As I have said before I am having a little bit of trouble and the help would be greatly appreciated.
Re: Help with !var/!loop
Try imacros javascript interface. It's fairly simple. I can't write any decent script without it.
Name the script "loop.js" and run it as usual.
To convert iim script to js script use "imacros code creator"(google).
Name the script "loop.js" and run it as usual.
Code: Select all
var i =0;
while (i<5)
{
iimDisplay(i);
var macro;
macro = "CODE:";
macro += "URL GOTO=http://google.com" + "\n";
macro += "WAIT SECONDS=4" + "\n";
iimPlay(macro);
i++;
}
Re: Help with !var/!loop
siniy wrote:Try imacros javascript interface. It's fairly simple. I can't write any decent script without it.
Name the script "loop.js" and run it as usual.
To convert iim script to js script use "imacros code creator"(google).Code: Select all
var i =0; while (i<5) { iimDisplay(i); var macro; macro = "CODE:"; macro += "URL GOTO=http://google.com" + "\n"; macro += "WAIT SECONDS=4" + "\n"; iimPlay(macro); i++; }
Wow, thanks a ton.
Is this compatible with iMacros for Firefox?
Re: Help with !var/!loop
I believe it will work just in firefox.
Re: Help with !var/!loop
Ok, just a few more questions (if you would be so kind) ;siniy wrote:I believe it will work just in firefox.
I am not a big java coder but, from my understanding "while (i<5)" I am assuming 5 is the number of loops you want it to play.
I'm not sure what goes where "CODE:" is in the sample code
And I don't quite understand what the iimDisplay and iimPlay actually means.
Also, is this a IF - THEN command, what I would like it to do is when a !VAR in iMacros has 25(# of loops) to TAG a html element.
Sorry for all the questions, I don't quite understand java.
Hope to hear back from you!
Re: Help with !var/!loop
Right, while (i<25) in your case.I am not a big java coder but, from my understanding "while (i<5)" I am assuming 5 is the number of loops you want it to play.
It is used in javascript interface to indicate beginning of imacros script.I'm not sure what goes where "CODE:" is in the sample code
iimPlay starts imacros commands. iimDisplay just for debugging purpose.And I don't quite understand what the iimDisplay and iimPlay actually means.
Play with the script.
Re: Help with !var/!loop
When I run your sample code
I get this error. "SyntaxError: unknown command: VAR, line: 1 (Error code: -910)"
Am I doing something wrong?
Code: Select all
var i =0;
while (i<25)
{
iimDisplay(i);
var macro;
macro = "CODE:";
macro += "URL GOTO=http://google.com" + "\n";
macro += "WAIT SECONDS=4" + "\n";
iimPlay(macro);
i++;
}
Am I doing something wrong?
Re: Help with !var/!loop
You filename must have .js extension, not .iim
Re: Help with !var/!loop
I saved the file as loop.js
Re: Help with !var/!loop
Oh, wow.
I didn't realize that having them in the folder mattered.
I was just running the scripts off a folder on my desktop.
Thank you once again.
I didn't realize that having them in the folder mattered.
I was just running the scripts off a folder on my desktop.
Thank you once again.