error - Image Property List did not contain "ImageName

I am trying to run the following script:

set theItemDelimiter to tab

put “/Users/test/Documents/Yeti.suite/data/en_add_dialog.txt” into the_text

Click “buttons/btn_add”

Click Text:(item 2 of line 58 of the_text), SearchType: Tolerant, TextSize:“10.5”,TextBackgroundColor:"(160,160,160)", Tolerance:70
catch foo
logerror foo
end catch

The script fails on the Click Text line with the following error:

Mon, 10/13/08 4:12:54 PM logerror Runtime Error at line 8: Error Running Script Command - click Error - Image Property List did not contain “ImageName” property

Can anyone point me in the right direction as to what is wrong?


Steve O’Sullivan

I see a couple of problems with your script. First, you are trying to set the ItemDelimiter to tab. By writing “theItemDelimiter” as a single word, it is treated as a variable name, not the itemDelimiter property, so this command just puts tab into a variable. To fix it, change this to two words: “the itemDelimiter”.

The other problem is this line:
put “/Users/test/Documents/Yeti.suite/data/en_add_dialog.txt” into the_text

This puts the path name of the file into the_text, but it looks like what you want is to read the contents of that file. To do this, you need to add the word “file”:

put file "/Users/test/Documents/Yeti.suite/data/en_add_dialog.txt" into the_text

Although we rarely use property lists without enclosing parentheses, your click command is syntactically correct. The problem, I think, is that the value being passed for the Text property is empty (the name of the file certainly doesn’t have 58 lines!), so Eggplant is looking for an image name instead and didn’t receive one. We’ll look and see if we can improve the error message that’s displayed in that case.