Hi All,
I want to take the chance to thank you all for all the helpful information I've been leeching since I started using MS...
I do have an issue here and your expertise is extremly appreciated; The script (below) works fine using MS. But when is compiled it gives me this error: "Invalid numeric value for MouseMove command"
I tried changing variables, removing spaces and adding a wait time infront but this wont fix the issue.
Thanks for your help.
>>Script
...
FindImagePos>C:\Autoprint\logs\reqlist.bmp,SCREEN,50,1,XPos,YPos,imgs
SetFocus>Microsoft Excel - List.xls
Let>XMove=XPos_0-10
Let>YMove=YPos_0+27
MouseMove>XMove,YMove
LClick
PRess Ctrl
Wait>0.5
Send>c
Release Ctrl
Wait>0.5
SetFocus>Docu*
WindowAction>1,Docu*
Wait>1
...
Invalid numeric value for MouseMove command - Help please
Moderators: Dorian (MJT support), JRL
Invalid numeric value for MouseMove command - Help please
Last edited by lim0n on Fri Feb 27, 2009 5:43 pm, edited 1 time in total.
Need to make sure image was found.
Need to check:
if>imgs=0
//XPos_0 and XPos_0 will not be assigned
endif
Gale
if>imgs=0
//XPos_0 and XPos_0 will not be assigned
endif
Gale
Hi lim0n,
FindImagePos>C:\Autoprint Docuware\logs\reqlist.bmp,SCREEN,50,1,XPos,YPos,imgs
Because this script works fine as is but fails when compiled, it has to be something weird.
I notice you have the following comment lines:
>>Script
>>image detection
>>If not found
Change those all as follows...
//Script
//image detection
//If not found
...then recompile the script and let us know how it works.
The Let> command handles that fine, don't need the % symbols... check the Help File.JRL wrote:Unless a variable is alone as a parameter it needs to have percents around it. So, for example, your lines:
Let>XMove=XPos_0-10
Let>YMove=YPos_0+27
need to be changedto:
Let>XMove=%XPos_0%-10
Let>YMove=%YPos_0%+27
Displays 95 for me as well... and it works the same way compiled so that can't be the problem.Me_again wrote:Surprisingly this displays 95 for me:
Let>XPos_0=100
Let>XMove=XPos_0-5
MDL>XMove
It happens in the following line:Me_again wrote:I don't see where there are values assigned to XPos_0 and YPos_0, unless that is done in some other part of the code it will cause XMove and YMove to have non-numeric values.
FindImagePos>C:\Autoprint Docuware\logs\reqlist.bmp,SCREEN,50,1,XPos,YPos,imgs
The variable names used were XPos and YPos so the first match will be returned in XPos_0 and YPos_0.out-take from FindImagePos Help File entry wrote:FindImagePos>bitmap_to_find,bitmap_to_scan|SCREEN,color_tolerance,return_center,X_Array,Y_Array,NumFound
X_Array is the name of a variable to store the X coordinates of each match. The first match is stored in X_Array_0, the second in X_Array_1, etc.
Y_Array is the name of a variable to store the Y coordinates of each match. The first match is stored in Y_Array_0, the second in Y_Array_1, etc.
Because this script works fine as is but fails when compiled, it has to be something weird.
I notice you have the following comment lines:
>>Script
>>image detection
>>If not found
Change those all as follows...
//Script
//image detection
//If not found
...then recompile the script and let us know how it works.
jpuziano
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -
Hi lim0n,
You're welcome, glad that solved it for you... however we should be thanking you as you discovered a compiling issue.
Using >> to start a comment should be OK according to the Help File...
If Marcus can replicate this issue... I'm sure it can be sorted.
I tend to stick with the following two commenting methods as both are brief and well tested:
//single line comment
/*
block comment
*/
I'm not sure what version you are running... but C style block comments /* .... */ were added in version 7.4.
Take care and thanks for posting your question so this could be discovered.
You're welcome, glad that solved it for you... however we should be thanking you as you discovered a compiling issue.
Using >> to start a comment should be OK according to the Help File...
However there seems to be a problem using >> to start a comment when the script is compiled.out-take from MS 11.1.04 Help File wrote:The Complete Script
So let's review the script. I have added comments to document the script – to make it more readable and easy to follow. You can use almost anything that isn't a recognised script command for comments. There is a reserved word called Remark which can be used:
Remark>This is a comment
But I've used // to indicate my comments. Some people like to use **. Use what you feel comfortable with – as long as it isn't a recognised script command – or it will try to execute your comments. Which could be interesting!
If Marcus can replicate this issue... I'm sure it can be sorted.
I tend to stick with the following two commenting methods as both are brief and well tested:
//single line comment
/*
block comment
*/
I'm not sure what version you are running... but C style block comments /* .... */ were added in version 7.4.
Take care and thanks for posting your question so this could be discovered.
jpuziano
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -