Getting String Value of Data Cell

Ok. I have a tableview and attached to that is data source CDCoversDataSource. The code below does work. It does exactly what I want. Later in the script I have a repeat which goes through the list that the repeat creates and if the “name” value is equal to the new one it reads from the list:

set theOrder to item 2 of item i of copyOfCDCoversDataSource
then…
set contents of data cell “order” of theRow to theOrder

Once again this works fine. I can now enter a value in to that data cell and run this function and it refreshes the list (which is what the function does), and it remembers the numbers I have associated with the columns. Now the problem is that I can’t get the value of contents of data cell “order” of theRow as a string, or integer… or any kind of data that I can use. Applescript seems to have no problem knowing what to do with it unless I ask it for the value of it as a string/text/integer. It saves it in to the list, it retrieves it and puts it back in to the data cell fine though… Any ideas?

set copyOfCDCoversDataSource to {}
	set theCount to count of data rows of CDCoversDataSource
	repeat with i from 1 to theCount
		set theOrder to contents of data cell "order" of data row i of CDCoversDataSource
		set theName to contents of data cell "name" of data row i of CDCoversDataSource
		set theCheckbox to contents of data cell "bigcheckbox" of data row i of CDCoversDataSource
		--display dialog (text of theOrder)
		set copyOfCDCoversDataSource to copyOfCDCoversDataSource & {{theName, theOrder, theCheckbox}}
	end repeat

Any ideas?

Just a bump - still trying to figure this one out. To simplify what I want to do:

This part already works:
I already have a table and data source… It reads from a directory and gets a list of images. I want to be able to enter in a number for each item in the list, and here is the (somewhat) tricky part - be able to refresh this list and keep the values I have associated with each one.

The thing that does not work is I am not able to get Applescript to make any sense out of the value (integer) I have associated with each. I can enter in a number, change them, refresh and it remembers their previous value. Everything displays fine. But I am unable to actually use the value I have entered. I want to be able to have a loop that will go through the images in order according to this number and run a function on each…

I still haven’t gotten this to work… no idea why still. Hoping this bump might help

This is what i use, it works fine:


set theData to data source of table view "vData" of scroll view "vData" of window "vData"
tell window "theWindow"
set theValue to contents of data cell "cellName" of data row 1 of theData
end tell