Just quickly, if I understand correctly, the aim of your script is to produce a list of imageName(s) in field “fileList”. These will be the images whose comments contain the key words you have searched for. I gather you want the script to select the line in field “fileList” which contains the imageName which the next line of the script goes on to display.
Perhaps try:
Code: Select all
select line lineOffset(tImageName, field "fileList") of field "fileList"
... which locates the correct line in field “fileList” and selects it. The selectedText is a function, which you can “put”, which returns the text string currently selected (if any). A good way to see what it does is to create a field which has the script:
Code: Select all
on mouseLeave
put the selectedText
end mouseLeave
... type in some text, select some words, then move the mouse out of the field, and watch the message box. It tells you what text is selected, whereas I think you want to locate a particular line of text, and have the script select it.
The many things you can get/set are properties, e.g.
Code: Select all
set the backgroundColor of button 1 to green
... because “backgroundColor” is a property of buttons which you can “get/set”. The selectedText is a function which, as mentioned, returns a value, that being the text string selected. Another example of a function is the time, i.e.
...which returns the current time.
Edit: I should have read your post with more care, because it was quite clear:
Purely for interface reasons, I would like to have the proper item highlited when the associated image is displayed.
Regards,
Michael