goto cmd use
Moderators: Dorian (MJT support), JRL
goto cmd use
Hi i'm trying to figure out if this script will work with the goto command. could someone quickly take a look at this and see if this makes sense?
CapsOff
Wait>3
SetFocus>my application*
\\WaitWindowChanged>1
Wait>15
Label>loop
Let>count=0
Let>max=100
Repeat>count
Let>count=count+1
SetFocus>my application *
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.11
Until>count,max
SetFocus>my application *
Wait>10
Press F3
Wait>3.11
Send>ibm
Wait>3.11 loop
Goto>end
SetFocus>Performance *
Wait>3.7
Press ALT
Wait>0.9
Send>a
Wait>0.86
Press Down
Wait>0.28
Press Enter
Wait>2.99
Label>end
CapsOff
Wait>3
SetFocus>my application*
\\WaitWindowChanged>1
Wait>15
Label>loop
Let>count=0
Let>max=100
Repeat>count
Let>count=count+1
SetFocus>my application *
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.11
Until>count,max
SetFocus>my application *
Wait>10
Press F3
Wait>3.11
Send>ibm
Wait>3.11 loop
Goto>end
SetFocus>Performance *
Wait>3.7
Press ALT
Wait>0.9
Send>a
Wait>0.86
Press Down
Wait>0.28
Press Enter
Wait>2.99
Label>end
when i use this script, it will constantly redo everything in a loop but it will never end..
this part never gets executed with the script:
Goto>end
SetFocus>Performance *
Wait>3.7
Press ALT
Wait>0.9
Send>a
Wait>0.86
Press Down
Wait>0.28
Press Enter
Wait>2.99
Label>end
how can i stop the loop and make it end? thank you
this part never gets executed with the script:
Goto>end
SetFocus>Performance *
Wait>3.7
Press ALT
Wait>0.9
Send>a
Wait>0.86
Press Down
Wait>0.28
Press Enter
Wait>2.99
Label>end
how can i stop the loop and make it end? thank you
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
No, the first part will loop forever because you have told it to. How many times do you want the first part to loop?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Ok, try this:
CapsOff
Wait>3
SetFocus>my application*
\\WaitWindowChanged>1
Wait>15
Let>numloops=0
Label>loop
Let>numloops=numloops+1
Let>count=0
Let>max=100
Repeat>count
Let>count=count+1
SetFocus>my application *
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.11
Until>count,max
SetFocus>my application *
Wait>10
Press F3
Wait>3.11
Send>ibm
Wait>3.11 numloopsloop
Goto>end
SetFocus>Performance *
Wait>3.7
Press ALT
Wait>0.9
Send>a
Wait>0.86
Press Down
Wait>0.28
Press Enter
Wait>2.99
Label>end
The first part will now only run twice. Modify the If>numloops<3,loop line for the number of iterations required.
CapsOff
Wait>3
SetFocus>my application*
\\WaitWindowChanged>1
Wait>15
Let>numloops=0
Label>loop
Let>numloops=numloops+1
Let>count=0
Let>max=100
Repeat>count
Let>count=count+1
SetFocus>my application *
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.11
Until>count,max
SetFocus>my application *
Wait>10
Press F3
Wait>3.11
Send>ibm
Wait>3.11 numloopsloop
Goto>end
SetFocus>Performance *
Wait>3.7
Press ALT
Wait>0.9
Send>a
Wait>0.86
Press Down
Wait>0.28
Press Enter
Wait>2.99
Label>end
The first part will now only run twice. Modify the If>numloops<3,loop line for the number of iterations required.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
thanks again for your help...it seems like after this part the script just stops..it does NOT redo the top part one more time.
script stops after here. before that it hits F3, then enters ibm which is correct
Wait>3.11 numloopsloop
Goto>end
SetFocus>Performance *
Wait>3.7
Press ALT
Wait>0.9
Send>a
Wait>0.86
Press Down
Wait>0.28
Press Enter
Wait>2.99
Label>end
script stops after here. before that it hits F3, then enters ibm which is correct
Wait>3.11 numloopsloop
Goto>end
SetFocus>Performance *
Wait>3.7
Press ALT
Wait>0.9
Send>a
Wait>0.86
Press Down
Wait>0.28
Press Enter
Wait>2.99
Label>end
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Yes it does. If you issue "Press Enter" then Enter is most certainly being pressed. What you really mean is that you saw no effect. Perhaps the wrong window was focused or the Press Enter command is issued too early or too late. Insert a SetFocus line before the key sends and make sure the Press Enter occurs at the right time.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
marcus
thank you for your help on this script, it works perfectly.
i'm not sure if this is possible but if i can trouble you for one more thing.
for this line:
Press F3
Wait>3.11
Send>ibm
Wait>3.11
Press Enter
wait>2.11
i would like to add something after it does the first loop "send>ibm"
and it goes to the top, after that is done i would like it to perform another SYMBOL change
so instead of send>ibm i like it to do
Press F3
Wait>3.11
Send>csco
Wait>3.11
Press Enter
wait>2.11
"csco" and then go back to the top again and redo all the other script..then finally goto end...
thank you.
thank you for your help on this script, it works perfectly.
i'm not sure if this is possible but if i can trouble you for one more thing.
for this line:
Press F3
Wait>3.11
Send>ibm
Wait>3.11
Press Enter
wait>2.11
i would like to add something after it does the first loop "send>ibm"
and it goes to the top, after that is done i would like it to perform another SYMBOL change
so instead of send>ibm i like it to do
Press F3
Wait>3.11
Send>csco
Wait>3.11
Press Enter
wait>2.11
"csco" and then go back to the top again and redo all the other script..then finally goto end...
thank you.
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Use the numloops counter to make a decision. Something like:
If>numloops=1
Send>ibm
Endif
If>numloops=2
Send>csco
EndIf
If>numloops ..... etc
If>numloops=1
Send>ibm
Endif
If>numloops=2
Send>csco
EndIf
If>numloops ..... etc
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
looks like i broke the loop,
the script doesn't go back to the top and perform the maxcount part. i like it to use Send>csco, then go back to the top "Label>loop" when its finished go and do Send>ibm then go to the top and perform the maxcount part and then finally just finish script.
//Recorded Events
CapsOff
Wait>3
SetFocus>TOne*
\\WaitWindowChanged>1
Wait>7
Let>numloops=0
Label>loop
Let>numloops=numloops+1
Let>count=0
Let>max=3
Repeat>count
Let>count=count+1
SetFocus>TOne *
Press CTRL
Wait>1.11
Send>g
Wait>1.11
Release CTRL
Wait>1.11
Press Down * %count%
Wait>1.11
Press Enter
Wait>10.11
Until>count,max
Wait>4
Press F3
Wait>1.11
Press F3
If>numloops=1
Wait>2.11
Send>csco
Wait>1.11
SetFocus>TOne*
Wait>2.11
Press Enter
wait>2.11
EndIf
Wait>4
Press F3
Wait>1.11
Press F3
If>numloops=2
Wait>2.11
Send>ibm
Wait>1.11
SetFocus>TOne*
Wait>2.11
Press Enter
wait>2.11
EndIf
If>numloopsloop
Goto>end
Label>end
SetFocus>Performance *
Wait>3.7
Press ALT
Wait>0.9
Send>a
Wait>0.86
Press Down
Wait>0.28
Press Enter
Wait>2.99
the script doesn't go back to the top and perform the maxcount part. i like it to use Send>csco, then go back to the top "Label>loop" when its finished go and do Send>ibm then go to the top and perform the maxcount part and then finally just finish script.
//Recorded Events
CapsOff
Wait>3
SetFocus>TOne*
\\WaitWindowChanged>1
Wait>7
Let>numloops=0
Label>loop
Let>numloops=numloops+1
Let>count=0
Let>max=3
Repeat>count
Let>count=count+1
SetFocus>TOne *
Press CTRL
Wait>1.11
Send>g
Wait>1.11
Release CTRL
Wait>1.11
Press Down * %count%
Wait>1.11
Press Enter
Wait>10.11
Until>count,max
Wait>4
Press F3
Wait>1.11
Press F3
If>numloops=1
Wait>2.11
Send>csco
Wait>1.11
SetFocus>TOne*
Wait>2.11
Press Enter
wait>2.11
EndIf
Wait>4
Press F3
Wait>1.11
Press F3
If>numloops=2
Wait>2.11
Send>ibm
Wait>1.11
SetFocus>TOne*
Wait>2.11
Press Enter
wait>2.11
EndIf
If>numloopsloop
Goto>end
Label>end
SetFocus>Performance *
Wait>3.7
Press ALT
Wait>0.9
Send>a
Wait>0.86
Press Down
Wait>0.28
Press Enter
Wait>2.99
The script presented as above loops multiple times (I tested it with the debugger).
It starts
does the down / ctrl+G thing three times
F3 and sends csco, does the 3 x ctrl+g thing again
F3 and sends ibm, does the 3 x ctrl + g thing again
Then it does the alt+a thing at the end (you forgot to release ALT).
(and here's something where you may not want it to do)
maxloops=2, so it starts the loop again...
At the top of the loop, it increases it to 3, but there is no if maxloops=3 routine, so it does the ctrl+g thing three times again.
Also, I don't know if you intended to do this or not, but inbetween the if maxloops=1 and if maxloops=2 sections, you hit F3 again twice.
So the loop's working fine, but I don't know if the minor things (like pressing F3 twice again) are causing your actions or windows to change and not be in the state you expect them to be.
Also, check the end of each line to make sure you don't have a hidden space, especially on the repeat and until lines. When pasting code here, you should use the CODE button so it surrounds your code in the tags.. and sometimes any characters will get interprated as HTML code and we won't see it (or we'll see it differently).
It starts
does the down / ctrl+G thing three times
F3 and sends csco, does the 3 x ctrl+g thing again
F3 and sends ibm, does the 3 x ctrl + g thing again
Then it does the alt+a thing at the end (you forgot to release ALT).
(and here's something where you may not want it to do)
maxloops=2, so it starts the loop again...
At the top of the loop, it increases it to 3, but there is no if maxloops=3 routine, so it does the ctrl+g thing three times again.
Also, I don't know if you intended to do this or not, but inbetween the if maxloops=1 and if maxloops=2 sections, you hit F3 again twice.
So the loop's working fine, but I don't know if the minor things (like pressing F3 twice again) are causing your actions or windows to change and not be in the state you expect them to be.
Also, check the end of each line to make sure you don't have a hidden space, especially on the repeat and until lines. When pasting code here, you should use the CODE button so it surrounds your code in the tags.. and sometimes any characters will get interprated as HTML code and we won't see it (or we'll see it differently).