what I want to do is to to read out a textfile (delimitered by return) and add the list to a table view that has any item in one row.
Everything is fine, if I put the text in a text view, but with the table I have some problems. What am I doing wrong?
on clicked theObject
if theObject is equal to button "import" of window of theObject then
set kara_file to open for access (choose file)
set kara_text to (read kara_file)'s paragraphs as list
repeat with i from 1 to number of items of kara_text
tell data source of table view "view" of scroll view "view" of window of theObject
set kara_line to make new data row at end of data rows
set contents of data cell "view" of newLine to kara_text
end tell
end repeat
end if
end clicked
This should work (assuming you’ve named your table & scroll view appropriately and have already initialized the data source with a single data column):