selection id from table

I’ve got a table with items linked to a data source. I’m trying to get at the info in the table with a double click. I’ve got the table responding to a double click, but I’m not sure what the best way to get at the data in the table is. Here is what I have been trying…


set theRow to id of selected data row of theObject
log theRow
set theDataSource to data source "datasource" of theObject
set theData to data row theRow of theDataSource
set theName to contents of data cell "FileName" of theData
set thePath to contents of data cell "FilePath" of theData
log theName

This is kind of working with two exceptions…

  1. Anytime I double click on the row I get an id of an item a little ways down.
  2. When the list is updated, the id’s are being incremented even higher. For example, if I had 40 items in my list, after the first update now item 1 is returning an id of 44 or something similar.

What is the best way to get at the data when double clicked?

Thanks,
Dave

Thanks, that is exactly what I was looking for.

Dave