why cannot find the read items?


This line of code reads the numbers(cannot read 1 though!) from the attached image, but the click statement with the same parameters cannot find some of the characters such as “9”.

Set keyboard to (635,471,1136,521)
Put ColorAtLocation(678,681) into var
Put readtext(keyboard, ValidCharacters: "0123456789", Contrast:On,ContrastColor: var, contrastTolerance:100) into readKeyboard

repeat 9 times  	
	put any character of readKeyboard into toClick
	Click Text:toClick, searchRectangle: keyboard, Contrast:On,ContrastColor: var, contrastTolerance:100
end repeat

Any suggestion would be appreciated.

I’ve looked at this and I don’t know why the text can be read but not found. It doesn’t make much sense to me either, although finding a single character is a bit different than reading what is essentially a string. The OCR has never been very good at seeing single characters. I’ll pass this to the developers, but I think for now you’d be better off using images in this situation.

It looks like you’ve omitted the ValidCharacters: “0123456789” property from your Click command. Perhaps that’s the problem? In any case, I agree that capturing images is probably a much better approach in this situation.