Does anybody knows how to set the tolerance value of an image using script? Thank you.
You can change the tolerance value used for all images of either the Precise or Standard search types by using the SetOption command:
setOption "PreciseImageTolerance", 8 setOption "StandardImageTolerance", 50
You can set the image tolerance (and other properties) on a per-image, per-use basis by using a property list as an argument to a command or function:
Click (ImageName:"MyImage", ImageTolerance:65) DoubleClick (ImageName: "DesktopIcon", SearchType: "Text", HotSpot: (0,0))
You can see the current values for an image by using the ImageInfo() function:
put ImageInfo( "MyImage" )
For a sample image, this produced the following output:
(CaptureLocation:("73","26"), HotSpot:("11","11"), ImageName:"/Users/matt/Documents/MySuite.suite/Images/MyImage.tiff", ImageSize:("22","23"), Pulsing:"false", SearchType:"Tolerant")
Note that in the above example, no key-value pair was printed for the “ImageTolerance” key used in an earlier example. This is because the image is set to use the default tolerance for its search type. If you were to go into the Info panel on the Images tab and override the default image tolerance value, then the “ImageTolerance” key value pair would be printed by the ImageInfo() function.