Puting sqlite data into a table

on became main theObject
	
	--Loads properties into table
	script loadProperties
		set dataLocation to space & "~/Documents/InvestorsToolbox/Management.db" & space
		set head to "sqlite3 -line" & dataLocation & quote
		set tail to quote
		set getAll to "select * from Property_Address;" & space
		set propertyAddresses to do shell script head & getAll & tail
		set contents of table view "propertylist" of scroll view "propertylist" of box "propertylist" of window "properties" to propertyAddresses
	end script
	
	--runs script to load properties into table
	run loadProperties
	
end became main

This does not work. I was completely guessing on the set contents line so I could be completely wrong with that. Do you have to get as detailed as to say what data goes into what columns? And do you have to prepare the sqlite data somehow before you can even put it in a table?

It comes down to knowing what is coming and having your table prepared to accept it. For instance, your line:

needs to return a list in order to be placed cleanly into a table. Further, if it is a list of lists, your table needs to be built with that framework in mind. For instance, if you get a list of 3 item lists from your do shell script, your table needs 3 columns to hold the data. As for this line:

It should work, if you have named the table, scroll, and window each to “propertylist” in IB. You do not need the box “propertylist”.

You can find further reading that may help here and here and here.

Good luck,