Repeat a script x times

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
brocco
Newbie
Posts: 2
Joined: Thu Jan 25, 2007 8:27 am

Repeat a script x times

Post by brocco » Thu Jan 25, 2007 8:40 am

I need to insert a list of names inside an online database. I have only a web form access and I can insert only 1 name a time.

The following script pick the name from the list and put it inside the form but I can find a command to repeat the script x time.

If I paste the same code x time the script is too big.
I know taht the metod is a little bit "orrible" but I have do do that asap.

Please help me! :oops: :oops:
Paolo

Scheduler\INSERISCI EMAIL.scp
// Recorded on giovedì, gennaio 25, 2007, at 09.06 AM

//Recorded Events
Let>WW_TIMEOUT=5
CapsOn
MouseMove>781,849
Wait>1
LClick
WaitWindowOpen>LISTA AMICI - OpenOffice.org Calc
MoveWindow>LISTA AMICI - OpenOffice.org Calc,-4,-4
ResizeWindow>LISTA AMICI - OpenOffice.org Calc,1160,838
Wait>0.02
MouseMove>1142,783
Wait>0.2
LClick
Wait>0.14
MouseMove>237,176
Wait>0.1
LClick
Wait>0.1
Press CTRL
Wait>0.1
Send>c
Wait>0.38
Release CTRL
Wait>0.06
MouseMove>645,849
Wait>0.1
LClick
WaitWindowOpen>GestioneMail - Windows Internet Explorer
MoveWindow>GestioneMail - Windows Internet Explorer,-4,-4
ResizeWindow>GestioneMail - Windows Internet Explorer,1160,838
Wait>0.08
MouseMove>625,360
Wait>0.2
LClick
Wait>0.2
Press CTRL
Wait>0.2
Send>v
Wait>0.2
Release CTRL
Wait>0.2
MouseMove>605,389
Wait>0.2
LClick

User avatar
JRL
Automation Wizard
Posts: 3504
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Thu Jan 25, 2007 2:24 pm

Check out the Repeat> Until function. I think it will do exactly what you are looking for.

brocco
Newbie
Posts: 2
Joined: Thu Jan 25, 2007 8:27 am

Post by brocco » Thu Jan 25, 2007 4:42 pm

I have some problem to apply the Repeat function. I don't have a value in the script, I have to build it. I Asked for a simple run the macro x times like in many text editor.
Thank
Paolo

User avatar
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

Post by Rain » Sat Jan 27, 2007 6:10 pm

I don't know why but I never use the repeat> function I guess I'm set in my old ways of scripting. The script below will do the same exact thing, in this case repeat 5 times which can be changed to the number of times you want to repeat the script (see notes in the script)

Code: Select all

Scheduler\INSERISCI EMAIL.scp
// Recorded on giovedì, gennaio 25, 2007, at 09.06 AM

//Recorded Events
Let>WW_TIMEOUT=5
CapsOn
LET>REPEAT=0
LABEL>REPEAT LOOP
wait>1
ADD>REPEAT,1
//Repeat scrip 5 times in this example
IF>REPEAT=5,DONE_REPEATING
//Cheange the number in "IF>REPEAT=5,DONE_REPEATING"
//from 5 to the number of times you want to repeat your script
//Insert your script after this point

GOTO>REPEAT LOOP
LABEL>DONE_REPEATING
MDL>I've repeated your script 5 times
I hope this was helpful.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts