This code never gets the data out of the table view. I am just trying to learn how to get some data out of a table view once it is populated from a MySQL DB. I am getting the data in there ok, but can’t get it out.
This is inside the on clicked theObject section. Basically I have a button that fires this code and then I try to display the_data in a dialog box.
try
tell window “main”
set the_data to (contents of data cell 1 of data row (selected row of table view “data” of scroll view “data”) of data source of table view “data” of scroll view “data”) as string
end tell
on error
set the_data to “”
end try
Are you sure both the table and its containing scroll view are named data and not just one or the other. Try referring to the table by its index instead of name to see if it helps. Also try telling the data source to return the value and, finally, use some parentheses before trying to coerce the value received (and you should probably use Unicode text instead of string for the coercion):