Storing a property in a saved Script File

I am very familiar with Studio’s User Defaults which is perfect for storing text, unicode text or anything that can be type cast as such, e.g., a boolean. But this time, I need to store an array of objects. So, I store this array in a script file …

… the saved script file looks like:

property theFiles : {}

… when I start up, I use

on loadFilesScript()

	try
		set filesScriptRef to choose file default location alias (path to me as string) ¬
			with prompt "Locate your 'allFiles.scpt'" of type {"osas"} without invisibles
		-- property theFiles : null -- allFiles.scpt
		set filesScriptObj to load script filesScriptRef
		
		set filesScriptLoaded to true
	on error errMsg number errNum
		if errNum = -128 then tell me to display dialog "User cancelled .. application will now quit"
		quit
	end try
	
end loadFilesScript

… and every time I change this object array, I use

set theFiles of filesScriptObj to newFiles
store script filesScriptObj in filesScriptRef replacing yes

… but, when I open the saved script file in Script Editor, it looks the same, i.e, count theFiles = 0

… maybe I need to implement one of the methods suggested by Adam Bell, hhas, Bruce Phillips ???

Any help is definitely appreciated.

I believe this is expected. I’ve used store script objects for a QuickTime script before, and the values weren’t visible in the file. However, if you look at the file with a hex editor (such as Hex Fiend), then you see that there is actual data in there.