Submit After Loop

Discussions and Tech Support specific to the iMacros Firefox add-on.
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
Tamilselvan
Posts: 129
Joined: Mon Mar 07, 2016 10:49 am

Submit After Loop

Post by Tamilselvan » Tue May 25, 2021 10:01 am

Firefox 52.9.0 (32-bit)
iMacros 8.9.7
Win-10 (64-bit)

Hi,
I have tried first time in Java Script... I need to press the submit button after the end of loop. Anybody guide me.

Code: Select all

var Min_Max; 
Min_Max = "CODE:"; 
Min_Max += "VERSION BUILD=8970419 RECORDER=FX" + "\n";  
Min_Max += "TAB T=1" + "\n";  
Min_Max += "SET !DATASOURCE Min-Max.csv" + "\n";  
Min_Max += "SET !VAR0 {{i}}" + "\n";  
Min_Max += "ADD !VAR0 1" + "\n";  
Min_Max += "SET !DATASOURCE_LINE {{!VAR0}}" + "\n";  
Min_Max += "TAG POS={{i}} TYPE=INPUT:TEXT FORM=ID:clusters_entry ATTR=ID:min_wage_rate* CONTENT={{!col1}}" + "\n";  
Min_Max += "TAG POS={{i}} TYPE=INPUT:TEXT FORM=ID:clusters_entry ATTR=ID:max_wage_rate* CONTENT={{!col2}}" + "\n";  
Min_Max += "TAG POS={{i}} TYPE=INPUT:TEXT FORM=ID:clusters_entry ATTR=ID:total_wages* CONTENT={{!col3}}" + "\n";  
i=1;
while(i<62)
{
	iimSet("i",i);
	iimPlay(Min_Max);
	i++;
}
if(i==62)
	{
		Min_Max += "ONDIALOG POS=1 BUTTON=OK CONTENT=" + "\n"; 
		Min_Max += "TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:clusters_entry ATTR=ID:submit" + "\n";
		//iimPlay(Min_Max);
	}
Thanks in Advance....
Regards,
S.Tamilselvan
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Submit After Loop

Post by chivracq » Tue May 25, 2021 10:31 am

Tamilselvan wrote:
Tue May 25, 2021 10:01 am
Firefox 52.9.0 (32-bit)
iMacros 8.9.7
Win-10 (64-bit)

Hi,
I have tried first time in Java Script... I need to press the submit button after the end of loop. Anybody guide me.

Code: Select all

var Min_Max; 
Min_Max = "CODE:"; 
Min_Max += "VERSION BUILD=8970419 RECORDER=FX" + "\n";  
Min_Max += "TAB T=1" + "\n";  
Min_Max += "SET !DATASOURCE Min-Max.csv" + "\n";  
Min_Max += "SET !VAR0 {{i}}" + "\n";  
Min_Max += "ADD !VAR0 1" + "\n";  
Min_Max += "SET !DATASOURCE_LINE {{!VAR0}}" + "\n";  
Min_Max += "TAG POS={{i}} TYPE=INPUT:TEXT FORM=ID:clusters_entry ATTR=ID:min_wage_rate* CONTENT={{!col1}}" + "\n";  
Min_Max += "TAG POS={{i}} TYPE=INPUT:TEXT FORM=ID:clusters_entry ATTR=ID:max_wage_rate* CONTENT={{!col2}}" + "\n";  
Min_Max += "TAG POS={{i}} TYPE=INPUT:TEXT FORM=ID:clusters_entry ATTR=ID:total_wages* CONTENT={{!col3}}" + "\n";  
i=1;
while(i<62)
{
	iimSet("i",i);
	iimPlay(Min_Max);
	i++;
}
if(i==62)
	{
		Min_Max += "ONDIALOG POS=1 BUTTON=OK CONTENT=" + "\n"; 
		Min_Max += "TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:clusters_entry ATTR=ID:submit" + "\n";
		//iimPlay(Min_Max);
	}
Thanks in Advance....
Regards,
S.Tamilselvan

Thread opened again...! in the wrong Sub-Forum, grrr...! :roll:
Threads about running a '.js' Script belong to the 'iMacros for FF' Sub-Forum... :idea:

>>>

But OK, your Script looks correct to me, (I'm nearly "impressed" for a first Try, ah-ah...! :D ), you only "forgot" to reuse 'iimSet()' just before the 2nd 'iimPlay()' in your Script, after the 'while' Loop, => when i=62. :idea:
Vars are by Design reset after each 'iimPlay()'.

>>>

The "if(i==62)" is not really needed, your Var can only have the Value "=62"...

And, hum..., unless you want to run this Script from the Task Scheduler, it would have been much easier to implement in pure '.iim', with simply 'EVAL()' to spit out a "1"/"0" for the "TAG POS=n" on the 'Submit' Button, => "1" only when '!LOOP'=62... :idea:
- (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...
Tamilselvan
Posts: 129
Joined: Mon Mar 07, 2016 10:49 am

Re: Submit After Loop

Post by Tamilselvan » Tue May 25, 2021 3:41 pm

Oh... Sorry.. Not to opened Thread in Correct / General Sub-Forum...... Next time It won't happen ..

I will try to grasp new things about js function.. like...iimSet(),

Lots of tried. Changing few things and testing myself. Finally its working..

Code: Select all

var Min_Max; 
Min_Max = "CODE:"; 
Min_Max += "VERSION BUILD=8970419 RECORDER=FX" + "\n";  
Min_Max += "TAB T=1" + "\n";  
Min_Max += "SET !DATASOURCE Min-Max.csv" + "\n";  
Min_Max += "SET !VAR0 {{i}}" + "\n";  
Min_Max += "ADD !VAR0 1" + "\n";  
Min_Max += "SET !DATASOURCE_LINE {{!VAR0}}" + "\n";  
Min_Max += "TAG POS={{i}} TYPE=INPUT:TEXT FORM=ID:clusters_entry ATTR=ID:min_wage_rate* CONTENT={{!col1}}" + "\n";  
Min_Max += "TAG POS={{i}} TYPE=INPUT:TEXT FORM=ID:clusters_entry ATTR=ID:max_wage_rate* CONTENT={{!col2}}" + "\n";  
Min_Max += "TAG POS={{i}} TYPE=INPUT:TEXT FORM=ID:clusters_entry ATTR=ID:total_wages* CONTENT={{!col3}}" + "\n";  
i=0;
while(i<=60)
{
	iimSet("i",i);
	iimPlay(Min_Max);
	i++;
}	
	Min_Max += "WAIT SECONDS=0.5" + "\n"; 
	Min_Max += "ONDIALOG POS=1 BUTTON=OK CONTENT=" + "\n"; 
	Min_Max += "TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:clusters_entry ATTR=ID:submit" + "\n";
	iimSet("i",i);
	iimPlay(Min_Max);
Thank You... :D
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Submit After Loop

Post by chivracq » Tue May 25, 2021 4:18 pm

Tamilselvan wrote:
Tue May 25, 2021 3:41 pm
Oh... Sorry.. Not to opened Thread in Correct / General Sub-Forum...... Next time It won't happen ..

I will try to grasp new things about js function.. like...iimSet(),

Lots of tried. Changing few things and testing myself. Finally its working..

Code: Select all

var Min_Max; 
Min_Max = "CODE:"; 
Min_Max += "VERSION BUILD=8970419 RECORDER=FX" + "\n";  
Min_Max += "TAB T=1" + "\n";  
Min_Max += "SET !DATASOURCE Min-Max.csv" + "\n";  
Min_Max += "SET !VAR0 {{i}}" + "\n";  
Min_Max += "ADD !VAR0 1" + "\n";  
Min_Max += "SET !DATASOURCE_LINE {{!VAR0}}" + "\n";  
Min_Max += "TAG POS={{i}} TYPE=INPUT:TEXT FORM=ID:clusters_entry ATTR=ID:min_wage_rate* CONTENT={{!col1}}" + "\n";  
Min_Max += "TAG POS={{i}} TYPE=INPUT:TEXT FORM=ID:clusters_entry ATTR=ID:max_wage_rate* CONTENT={{!col2}}" + "\n";  
Min_Max += "TAG POS={{i}} TYPE=INPUT:TEXT FORM=ID:clusters_entry ATTR=ID:total_wages* CONTENT={{!col3}}" + "\n";  
i=0;
while(i<=60)
{
	iimSet("i",i);
	iimPlay(Min_Max);
	i++;
}	
	Min_Max += "WAIT SECONDS=0.5" + "\n"; 
	Min_Max += "ONDIALOG POS=1 BUTTON=OK CONTENT=" + "\n"; 
	Min_Max += "TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:clusters_entry ATTR=ID:submit" + "\n";
	iimSet("i",i);
	iimPlay(Min_Max);
Thank You... :D

Yep, very good...!, exactly what I meant... :D
And the "funny" Thing is that's I've never written any single '.js' Script, ah-ah...! I only use pure '.iim' Scripts for myself... :P

>>>

And the Forum Admin has already moved the Thread to the 'iMacros for FF' Sub-Forum... Thanks to them for that... :wink:
- (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