Text Image problem

I am using the text image generator to find text in a treeview. My problem is, some strings are found and some are not, in the same treeview.

“da org” - found
“da acc” - found
“da cost” - not found
“TRADER” - not found
“TRA” - not found, clicks my FINISH button instead!

Any ideas on how to make this more reliable?

Please post a screenshot and the commands you are using to find the text. There’s not enough information here to diagnose the issue.

I have text styles set up in preferences.

Here is my code:

// driver code
ClickText "da org"

// ClickText
Params text
put ImageFromText(text) into image
if image <> null then
   click image
end if

// ImageFromText
Params text

if imageFound( (Text:text, TextPlatform:"WindowsXP", TextStyle:"Default")) then
	return  (Text:text, TextPlatform:"WindowsXP", TextStyle:"Default")
else if imageFound( (Text:text, TextPlatform:"WindowsXP", TextStyle:"Default_Selected")) then 
	return (Text:text, TextPlatform:"WindowsXP", TextStyle:"Default_Selected")
else if imagefound((Text:text, TextPlatform:"WindowsXP", TextStyle:"Default_Highlighted")) then
	return (Text:text, TextPlatform:"WindowsXP", TextStyle:"Default_Highlighted")
	return null
end if

First, let me apologize for the fact that this post never received a response; I didn’t get a notification that a response had been posted and I just stumbled across it today.

If you’re still struggling with this issue, I have a couple of suggestions. The first is to try reducing the TextSize parameter by .25 points – the Windows TIG tends to generate text that is a little too big when the point size is 10 or less. So if you’re working with a 10-pt font, try specifying a size of 9.75.

Also, since you’re working against Windows, you don’t really need to use the Text search type; you might have better luck (fewer false positives) if you override the search type to be Tolerant. The Text search type (which is used by default with Text Images) is meant to accommodate the dynamic antialiasing used on the Mac; Windows uses a much simpler form of text antialiasing. So your ImageFound function would look like this:

imageFound( (Text:text, TextPlatform:"WindowsXP", TextStyle:"Default", SearchType:"Tolerant"))

Please let us know if you continue to have issues with this and we’ll be glad to help you troubleshoot further.