counter macro how?
Moderators: Dorian (MJT support), JRL
counter macro how?
Hi i am curious if someone could point me to the right direction on how to make this script simple.
i need to make a script to perform
Ctrl-G then press down
and repeat but ALWAYS increase by 1 until 100.
ie.
press ctrl-g then down
wait 50secs
press ctrl-g then down key 2times.
wait 50secs
press ctrl-g then down key 3 times.
until 100 times.
below is something i have but not really efficient.
Press CTRL
Wait>2.11
Send>g
Wait>2.11
Release CTRL
Wait>2.11
Press Down
Wait>3.11
Press Enter
Wait>50.50
Press CTRL
Wait>2.11
Send>g
Wait>2.11
Release CTRL
Wait>2.11
Press Down * 2
Wait>3.11
Press Enter
Wait>50.50
Press CTRL
Wait>2.11
Send>g
Wait>2.11
Release CTRL
Wait>2.11
Press DOWN *3
i need to make a script to perform
Ctrl-G then press down
and repeat but ALWAYS increase by 1 until 100.
ie.
press ctrl-g then down
wait 50secs
press ctrl-g then down key 2times.
wait 50secs
press ctrl-g then down key 3 times.
until 100 times.
below is something i have but not really efficient.
Press CTRL
Wait>2.11
Send>g
Wait>2.11
Release CTRL
Wait>2.11
Press Down
Wait>3.11
Press Enter
Wait>50.50
Press CTRL
Wait>2.11
Send>g
Wait>2.11
Release CTRL
Wait>2.11
Press Down * 2
Wait>3.11
Press Enter
Wait>50.50
Press CTRL
Wait>2.11
Send>g
Wait>2.11
Release CTRL
Wait>2.11
Press DOWN *3
Like this perhaps:
Let>count=0
Let>max=100
Repeat>count
Let>count=count+1
Press CTRL
Send>g
Release CTRL
Press Down * count
Wait>50
Until>count=max
Let>count=0
Let>max=100
Repeat>count
Let>count=count+1
Press CTRL
Send>g
Release CTRL
Press Down * count
Wait>50
Until>count=max
MJT Net Support
[email protected]
[email protected]
Try the Repeat Until command. This example presses down arrow on an excel spreadsheet. if you don't have excel, just use any word processor, but be sure to change the SetFocus> command to reflect the appropriate window name.
It might go something like this.
let>counter=0
Repeat>counter
let>counter=counter+1
setfocus>Microsoft Excel*
wait>1
Press Down * %counter%
Until>cntr,100
It might go something like this.
let>counter=0
Repeat>counter
let>counter=counter+1
setfocus>Microsoft Excel*
wait>1
Press Down * %counter%
Until>cntr,100
Thank you for your help, very much appreciated.
i am now getting an error message
Macro Scheduler Information: "Error - Label Not FOUND!"
my script looks like this:
//Recorded Events
CapsOff
Let>count=0
Let>max=100
Wait>13.74
Press CTRL
Wait>2.11
Send>g
Wait>2.11
Release CTRL
Wait>2.11
Press Enter
Wait>5
Repeat>count
Let>count=count+1
Press CTRL
Wait>1.11
Send>g
Wait>1.11
Release CTRL
Wait>1.11
Press Down * count
Wait>1.11
Press Enter
Wait>50
Until>count=max
i am now getting an error message
Macro Scheduler Information: "Error - Label Not FOUND!"
my script looks like this:
//Recorded Events
CapsOff
Let>count=0
Let>max=100
Wait>13.74
Press CTRL
Wait>2.11
Send>g
Wait>2.11
Release CTRL
Wait>2.11
Press Enter
Wait>5
Repeat>count
Let>count=count+1
Press CTRL
Wait>1.11
Send>g
Wait>1.11
Release CTRL
Wait>1.11
Press Down * count
Wait>1.11
Press Enter
Wait>50
Until>count=max
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
thanks again for your help -- i did the edit/ remove trailing spaces which did not work.
it looks like i'm REQUIRED to use Label>start and Goto commands. i've refined my script below.
the only issue now that i have is the script does NOT stop at 100. the Until>count=max is underneath Goto cmd but if i place the Until command before Goto cmd the script breaks.
any suggestions?
my script looks like this:
//Recorded Events
CapsOff
Wait>10
Let>count=0
Let>max=100
Label>Start
Repeat>count
Let>count=count+1
Press CTRL
Wait>1.11
Send>g
Wait>1.11
Release CTRL
Wait>1.11
Press Down * %count%
Wait>1.11
Press Enter
Wait>4.37
Goto>Start
Until>count=max
Label>Exit
it looks like i'm REQUIRED to use Label>start and Goto commands. i've refined my script below.
the only issue now that i have is the script does NOT stop at 100. the Until>count=max is underneath Goto cmd but if i place the Until command before Goto cmd the script breaks.
any suggestions?
my script looks like this:
//Recorded Events
CapsOff
Wait>10
Let>count=0
Let>max=100
Label>Start
Repeat>count
Let>count=count+1
Press CTRL
Wait>1.11
Send>g
Wait>1.11
Release CTRL
Wait>1.11
Press Down * %count%
Wait>1.11
Press Enter
Wait>4.37
Goto>Start
Until>count=max
Label>Exit
Actually this is correct. Since 7.3.10.5 Until can take either format. It can also take , or symbols. The backward compatible comma is the same as the equals sign.SkunkWorks wrote:The syntax for the UNTIL> line is wrong. Look at the code I poste earlier.
Repeat>X
some code here
Until>X,Value
NOT Until>X=value
btw, in my code I misnamed the final value cntr and it should be counter....sorry.
MJT Net Support
[email protected]
[email protected]
Odd. You sure you have the correct version? The following is copied directly from the latest help file:
"Until>variable,finalvalue
Use in conjunction with Repeat. Iterates the code from the Repeat statement to the Until statement until the specified expression in the Until statement becomes true. Until can take one of the following simple expressions:
variable,value
for backward compatibility. Same as variable=value
variable=value
Until variable equals the value specified
variable>value
Until variable is greater than the value specified
variablevalue
Until variable does not equal the value specified"
"Until>variable,finalvalue
Use in conjunction with Repeat. Iterates the code from the Repeat statement to the Until statement until the specified expression in the Until statement becomes true. Until can take one of the following simple expressions:
variable,value
for backward compatibility. Same as variable=value
variable=value
Until variable equals the value specified
variable>value
Until variable is greater than the value specified
variablevalue
Until variable does not equal the value specified"
MJT Net Support
[email protected]
[email protected]