get and set selectedText
Posted: Fri Jul 23, 2010 11:04 pm
Hi, I have an array that I'm using to store comments about various image files. I am now trying to search the comments for keywords, and when I find hits, create a list and display the image and comments. Below is an excerpt of my code:
Most of this works. The problem is setting the selectedText attribute of the list field. If I write "get" instead of "set", I can get the selected text, but for some reason I can't compile the set command. Everything works as expected except for the "set the selectedText" part. Purely for interface reasons, I would like to have the proper item highlited when the associated image is displayed.
If I can "get" the attribute, why can't I "set" it? Aren't the commands analogous?
Thanks,
--Doug
Code: Select all
on mouseUp
set the itemDelimiter to return
put the text of field "SearchTerms" into tSearchTerm
repeat with x = 1 to the number of lines in the keys of gData
put gData[line x of the keys of gData] into tTextToSearch
if tSearchTerm is among the words of tTextToSearch then
put item x of the keys of gData into tImageName
put (tImageName & return) before tnewData
end if
end repeat
delete the last char of tnewData
put tnewData into field "fileList"
set the selectedText of field "fileList" to tImageName
displayImage (tImageName)
end mouseUp
If I can "get" the attribute, why can't I "set" it? Aren't the commands analogous?
Thanks,
--Doug