Only works fine pressing Left Shift
Moderators: Dorian (MJT support), JRL
Only works fine pressing Left Shift
Hi, I'm spanish...my english is very bad, but I'll try to explain my problem
I have a script with a loop. The script copy a text of web and paste in excel. If de loop execute one time there aren't problems. If are 2 or more loops, Macro Scheduler (v. hold on.
I removed the loop and I extended the code, but the problem continued again.
I discover if before the second time the loop execute, I press the key left shift, it run fine. I prove to put the command "Press Lshift" but it doesn't work, the only solution it's press manually the key.
How can i solve it?
Sorry with my English..
I have a script with a loop. The script copy a text of web and paste in excel. If de loop execute one time there aren't problems. If are 2 or more loops, Macro Scheduler (v. hold on.
I removed the loop and I extended the code, but the problem continued again.
I discover if before the second time the loop execute, I press the key left shift, it run fine. I prove to put the command "Press Lshift" but it doesn't work, the only solution it's press manually the key.
How can i solve it?
Sorry with my English..
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Do you have a "Release LShift" to correspond with the "Press LShift" - do you make sure you repeat the key before the next loop? Do you ensure the correct window has the focus - do you have a SetFocus line before the key sends? Does the focus shift before the next loop iteration? Is the loop jumping too fast? Do you need a Wait statement somewhere? Have you tested it with the debugger?
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?
using the debugger, the problem is here, in Ldown, do the key shift seems press
CapsOff
MouseMove>471,376
Wait>2.45
LClick
Wait>0.11
MouseMove>1164,275
Wait>4.1
Press Page Down * 7
Wait>0.02
MouseMove>974,733
Wait>4.57
Press Shift * 10
Wait>0.49
LDown
Wait>1
Press Shift * 2
Wait>1
LUp
Press Shift * 18
Send>
Wait>1.23
Wait>1
MouseMove>64,37
Wait>1.1
CapsOff
MouseMove>471,376
Wait>2.45
LClick
Wait>0.11
MouseMove>1164,275
Wait>4.1
Press Page Down * 7
Wait>0.02
MouseMove>974,733
Wait>4.57
Press Shift * 10
Wait>0.49
LDown
Wait>1
Press Shift * 2
Wait>1
LUp
Press Shift * 18
Send>
Wait>1.23
Wait>1
MouseMove>64,37
Wait>1.1
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
all code:
Let>n=0
Let>k=0
Repeat>n
Input>n,Whatt page (0-14) should be %n% ?
IF>n>14
Let>n=-1
ENDIF
Until>n>-1
Let>k=n
Repeat>k
Let>WW_TIMEOUT=5
CapsOff
MouseMove>98,434
Gosub>rc
Wait>t
Wait>1
LClick
Wait>2.5
MouseMove>938,267
wait>2
Press Page Up * 6
Wait>1.51
LClick
Let>d=0
Repeat>d
IF>nrc
Wait>0.2
Let>d=d+1
ENDIF
Until>d=n
Gosub>rc
Wait>t
Press Enter
Let>WW_TIMEOUT=5
CapsOff
MouseMove>471,376
Wait>2.45
LClick
Wait>0.11
MouseMove>1164,275
Wait>4.1
Press Page Down * 7
Wait>0.02
MouseMove>974,733
Wait>4.57
Press Shift * 10
Wait>0.49
LDown
Wait>0.02
Press Shift * 2
Wait>0.02
LUp
Press Shift * 18
Send>
Wait>1.23
MouseMove>64,37
Wait>1.1
LClick
Wait>0.14
MouseMove>113,124
Wait>1.15
LClick
Wait>0.09
MouseMove>468,784
Wait>0.5
LClick
//to excel
Let>WW_TIMEOUT=5
CapsOff
MouseMove>62,145
Wait>2.64
RClick
Wait>0.18
MouseMove>160,225
Wait>1.7
LClick
Wait>0.1
Press Down * 2
Wait>0.6
Press Enter
WaitWindowOpen>Pegado especial
MoveWindow>Pegado especial,0,60
ResizeWindow>Pegado especial,491,303
Wait>0.11
MouseMove>68,147
Wait>0.3
LClick
Wait>0.5
IF>n1
Let>WW_TIMEOUT=5
CapsOff
MouseMove>279,783
Wait>0.1
LClick
WaitWindowOpen>Microsoft Excel - Libro1
MoveWindow>Microsoft Excel - Libro1,-4,-4
ResizeWindow>Microsoft Excel - Libro1,1288,778
Wait>0.01
MouseMove>105,431
Let>k=k+1
Let>z=n
Let>n=0
Let>n=z
Let>n=n+1
Until>k=14
Message>all OK %n%
//SRT
SRT>rc
Repeat>t
Random>10,t
Until>tt=t/10
End>rc
Let>n=0
Let>k=0
Repeat>n
Input>n,Whatt page (0-14) should be %n% ?
IF>n>14
Let>n=-1
ENDIF
Until>n>-1
Let>k=n
Repeat>k
Let>WW_TIMEOUT=5
CapsOff
MouseMove>98,434
Gosub>rc
Wait>t
Wait>1
LClick
Wait>2.5
MouseMove>938,267
wait>2
Press Page Up * 6
Wait>1.51
LClick
Let>d=0
Repeat>d
IF>nrc
Wait>0.2
Let>d=d+1
ENDIF
Until>d=n
Gosub>rc
Wait>t
Press Enter
Let>WW_TIMEOUT=5
CapsOff
MouseMove>471,376
Wait>2.45
LClick
Wait>0.11
MouseMove>1164,275
Wait>4.1
Press Page Down * 7
Wait>0.02
MouseMove>974,733
Wait>4.57
Press Shift * 10
Wait>0.49
LDown
Wait>0.02
Press Shift * 2
Wait>0.02
LUp
Press Shift * 18
Send>
Wait>1.23
MouseMove>64,37
Wait>1.1
LClick
Wait>0.14
MouseMove>113,124
Wait>1.15
LClick
Wait>0.09
MouseMove>468,784
Wait>0.5
LClick
//to excel
Let>WW_TIMEOUT=5
CapsOff
MouseMove>62,145
Wait>2.64
RClick
Wait>0.18
MouseMove>160,225
Wait>1.7
LClick
Wait>0.1
Press Down * 2
Wait>0.6
Press Enter
WaitWindowOpen>Pegado especial
MoveWindow>Pegado especial,0,60
ResizeWindow>Pegado especial,491,303
Wait>0.11
MouseMove>68,147
Wait>0.3
LClick
Wait>0.5
IF>n1
Let>WW_TIMEOUT=5
CapsOff
MouseMove>279,783
Wait>0.1
LClick
WaitWindowOpen>Microsoft Excel - Libro1
MoveWindow>Microsoft Excel - Libro1,-4,-4
ResizeWindow>Microsoft Excel - Libro1,1288,778
Wait>0.01
MouseMove>105,431
Let>k=k+1
Let>z=n
Let>n=0
Let>n=z
Let>n=n+1
Until>k=14
Message>all OK %n%
//SRT
SRT>rc
Repeat>t
Random>10,t
Until>tt=t/10
End>rc
Why are you pressing SHIFT 10 times? in the normal course of an application, you might Press SHIFT then RELEASE SHIFT at some point before continuing.
LDown (just for clarification) is the act of Pressing the left Mouse Button.
Does your application use Shift to move between fields? what application are you automating?
LDown (just for clarification) is the act of Pressing the left Mouse Button.
Does your application use Shift to move between fields? what application are you automating?
ok, Why don't we all start over on this one.
I suggest you try to write (in as much detail as possible) the actual process you are trying to automate. Do not just post code bits. My guess is that we can show you how to create a quality end-user application if you can describe what it is you want.
You are trying to capture data from a screen? Then maybe write it to Excel?
I suggest you try to write (in as much detail as possible) the actual process you are trying to automate. Do not just post code bits. My guess is that we can show you how to create a quality end-user application if you can describe what it is you want.
You are trying to capture data from a screen? Then maybe write it to Excel?
First time I record the movements, copy a text of a web, change to excel, paste, leave the cursor in the correct position for the next loop, advance one page of web...again.
I use this program (it's very very good) since one week. Because I record, after write more code, the loop...and press shift 10 times is automatic, I don't write, was the program.
I use this program (it's very very good) since one week. Because I record, after write more code, the loop...and press shift 10 times is automatic, I don't write, was the program.
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
You have no Release LShift statements. Therefore subsequent calls of this will be problematic since it thinks LShift is already pressed and thus all subsequent keysends will be sent WITH LShift. At the end of the loop add this:
Release LShift
Release LShift
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?
mtettmar wrote:You have no Release LShift statements. Therefore subsequent calls of this will be problematic since it thinks LShift is already pressed and thus all subsequent keysends will be sent WITH LShift. At the end of the loop add this:
Release LShift
I added that, and the problem continue... perhaps I should to do a new script...