Script is Deleting Spaces in Script

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
treniets
Newbie
Posts: 4
Joined: Fri Oct 05, 2007 12:52 am

Script is Deleting Spaces in Script

Post by treniets » Sat Jan 12, 2008 10:31 pm

I’ve been having problems with spaces disappearing from my script. For example, if my script is:

Code: Select all

FindImagePos>c:\Documents and Settings\John J Doe\My Documents\My Images\FindHC.bmp,c:\Documents and Settings\John J Doe\My Documents\My Images\capturefirst.bmp,CV,1,X,Y,NumFound
If>NumFound=-1
message>Error Finding %FindHC%
Wait>5
EndIf
After running the script the file names may look something like: \John JDoe\ or \JohnJ Doe\.

I put in the error message to give me a warning when it occurs. I can fix it with Search/Replace, but it is still awfully frustrating. It’s happened so often that I am convinced it’s not my typing.

Any help? When could it be happening? When I am running manually from the scrip editor (the advanced Editor)? My script Sets Focus on a window that may not be open, I click ignore when I am debugging. Could it be leaving focus on my script and changing it? (There are no ‘delete’ commands in my script.) It doesn’t seem to be limited to commands; even some of my comments have missing spaces. I haven't noticed any actual text being deleted. The FindImage command seems to be affected most often, but I have about sixty lines of it with lots of looping through them, so they are the most likely to be hit.

I have also placed an error message in:

Code: Select all

SetFocus>xxxxx*
ScreenCapture>CTX,CTY,CBX,CBY,C:\Documents and Settings\John J Doe\My Documents\My Images\capturefirst.bmp
If>SCREENCAP_RESULT>0
message>Error Screen Capture, SCREENCAP_RESULT = %SCREENCAP_RESULT%
EndIf
The script is setting SCREENCAP_RESULT to 4. What does 4 mean, it is not mentioned in the Help files, only 0, 1, 2, and 3 are mentioned. I assume it is happening because I am only Stepping through part of the script and the CTX etc. coordinates are not defined. If I knew what 4 meant it would help me write a reasonable error message.

I’m running version 10.014 with Windows XP. I don’t know if it was happening in the earlier version.

Also, when I search the forum, look at a post and try to go back to the “Foundâ€

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Re: Script is Deleting Spaces in Script

Post by Me_again » Sun Jan 13, 2008 12:19 am

[quote="treniets"]Also, when I search the forum, look at a post and try to go back to the “Foundâ€

Sbleck
Newbie
Posts: 2
Joined: Tue Jul 29, 2008 8:55 pm

"SCREENCAP_RESULT to 4" issues...

Post by Sbleck » Tue Jul 29, 2008 9:06 pm

Hi,

Regarding to this:

"
The script is setting SCREENCAP_RESULT to 4. What does 4 mean, it is not
mentioned in the Help files, only 0, 1, 2, and 3 are mentioned. I assume it is happening because I am only Stepping through part of the script and the CTX etc. coordinates are not defined. If I knew what 4 meant it would help me write a reasonable error message.
"

I made the same mistake (unfortunately), some minutes ago. The reason is having spaces when used the GetScreenRes command (like doing "GetScreenRes>Max_X, Max_Y" in place of "GetScreenRes>Max_X,Max_Y"). Below is the explanation:

"
> Spaces should be avoided by default. Read help file topic
> IGNORESPACES for more info. THIS IS BY DESIGN
"

Just removed the spaces and the SCREENCAP_RESULT to 4 disappeared...

HTH,
Sbleck

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts