Appending data source with list makes copies, other methods?

Given that the applescript docs on apple’s website are totally base, I have found an issue which I can’t resolve.

I’m loading a table with records created from a list of files on disk. The table has two columns, filename, and “state”.

When I double click an item in the table, I need to change the state so that I know I’ve clicked on that item.

Currently, I’m using:


set tableData to {}
.../fill up the tableData with new contents.
append (last item of data sources) with tableData

In a method called “LoadData” which just reloads the contents from disk.
Is there a way to clear the contents of the table prior to doing this?

Thanks,

-thomas



Edited: 10/10/03

The solution ( of course, this is Applescript after all ) is quite simple:


on myTableUpdateHandler()
set tableView to table view “tableView” of ¬
scroll view “tableView” of window 1
delete every data row of data source of tableView

(*
 ..... update your actual record list here
 ..... reload from finder contents or whatever
 *)

append data source of tableView with tableData

end



I've taken to splitting everything out into it's own method, and I'd like to find some information on using seperate script files, and how those files interact. But that's another thread altogether. Is anyone else sick of "Save" throwing the current insertion point to the end of the document? My god!

-Thomas