HELP: need to save table view contents as a text file.

Firstly, I suggest quoting only a bit of the previous post, or none, rather than the whole thing (which adds nothing).

It’s difficult to diagnose that error without knowing the exact point in the script that initiated it.

I’ve posted my very simple test project here:
http://www.tandb.com.au/downloads/Table_View_Saver.zip

See how you go running it. Click Fill, Write, Read buttons.

Tom
Barefeet
http://www.tandb.com.au/applescript/


		
                if name of theObject is "Save" then
                     tell window of theobject
			set myDataList to contents of table view "TCTable" of scroll view "TCTable"
			set writeRef to open for access dataFile with write permission
			try
				set eof writeRef to 0
				write myDataList to writeRef
				close access writeRef
			on error errorMessage
				close access writeRef
 				error errorMessage
			end try
                    end tell
		else if name of theObject is "Import" then
			set myDataList to read dataFile as list
			set contents to myDataList
		end if


barefeet,

This is how i used the code you provided. i keep getting the error: AppleEvent handler failed. (-10000)
i am sure the reference of the TCTable is correct. what could be wrong? i have a table view in my nib. the contents of the table view is dynamic where you fill out a form and click an add button to add it to the table view contents. all i need is a save and read button to make my day.

Thanks.

Did you try the complete project that I created for you to download? Did it work OK for you? I suggest you try modifying that project bit by bit with your own GUI objects and code until you discover what’s causing the problem.

Tom
BareFeet