I need to loop through the contents of a multi-column table view, get
the contents as a list of records (or any other way, honestly. I'm an
American, after all, coercion is our specialty, these days), and the
following is my current, unsuccessful attempt.
on SaveTheData()
set MyTable to (data source of table view 1 of scroll view 1 of
window 1)
set the_count to (count data rows of MyTable)
repeat with i from 1 to the_count
set myRow to data row i of MyTable
set selected data row of MyTable to myRow
set MyDataSnippet1 to contents of data cell 1 MyRow
set MyDataSnippet2 to contents of data cell 2 MyRow
set MyDataSnippet3 to contents of data cell 3 MyRow
set MyOutListItem to {item1:MyDataSnippet1, item2:MyDataSnippet2,
item3:MyDataSnippet3}
set this_data to ((MyOutListItem) as text) & return
set this_file to (((path to desktop folder) as text) &
"dataTextTest.txt")
my write_to_file2(this_data, this_file, true)
end repeat
end SaveTheData
there'll be more for it to do once I get it to do anything but return
an error message. What I want to do is append each row's contents to a
text file.
To the best of my ability to determine, the problem is setting the
selected row. Applescript says:
Can't make «class seDR» of «class datS» id 15 into type reference.
(-1700)
Any clues?
TIA!
Joshua


|