Hello Everyone,
I have written the following script
GetClipBoard>Q,0
wait>WaitTime
SetFocus>Shipment 3*
wait>WaitTime
MouseMoveRel>410,268
LClick
wait>WaitTime
Let>N=0
if>Q>0
Let>Q=Q*1
Repeat>N
Let>N=N+1
Send +
wait>WaitTime
Until>N=Q
endif
The script copies a value from an Excel and should then press the + key in another program the value from the cell in Excel (Variable Q). I can see in the debugger that it is properly setting Q=2 but the loop will not end even once N=2 and therfore N=Q. It seems that the getclipboard function might be storing the value from Excel not as an integer?
I have tried changing the format of the cell in Excel to number with no decimal places but same result the loop just keeps repeating forever. I have also tried using INPUT and entering Q when running the script and in that case the loop ends correctly when N=2 and Q=2 IE N=Q.
Any help is appreciated
Get Clipboard as a variable in a loop
Moderators: Dorian (MJT support), JRL
Re: Get Clipboard as a variable in a loop
I should specify the reason for
Let>Q=Q*1
Was an attempt to see if I could force the variable into a numerical value as I assumed that was what the issue was.
However that also did not work.
Let>Q=Q*1
Was an attempt to see if I could force the variable into a numerical value as I assumed that was what the issue was.
However that also did not work.
Re: Get Clipboard as a variable in a loop
Hello everyone
For anyone who comes accross this I was actually able to resolve this by using XLGetSelectedCell and setting the cell variable to Q.
This script now works every time!
For anyone who comes accross this I was actually able to resolve this by using XLGetSelectedCell and setting the cell variable to Q.
This script now works every time!
- Grovkillen
- Automation Wizard
- Posts: 1128
- Joined: Fri Aug 10, 2012 2:38 pm
- Location: Bräcke, Sweden
- Contact:
Re: Get Clipboard as a variable in a loop
Try longer variable names as a start.