The function selectedline returns a text description in the form "line 4 of field 3". I have attempted and failed to use this directly to extract some text stored in a field e.g. put item 2 of the selectedline of me into myVariable. I have tried various permutations and locations for the code without success. In the end I resorted to the following code which is attached to a field object:
Code: Select all
on mouseUp
put the selectedline of me into tLine -- user clicks on a line in the field
answer "tLine is set to : " & tLine // "line 4 of field 3"
put word 2 of tLine into tLineNo // 4
answer "tLineNo is " & tLineNo
set itemdelimiter to tab
put item 2 of line tLineNo of me into tFileName
answer "File Name: " & tFileName // correctly returns the second item
End Mouseup
thanks