How do I store info on a computer?

I want to be able to store (and recall and modify) info ie preferences on a person’s computer, but I don’t want to use properties because then they stay the same if the program is copied onto another account. Opening a program like TextEdit and saving files is too blinking obvious because you can see it running. Could someone give me a run through of how to do this. Slowly please - I’m fairly amateur.

Any help would be greatly appreciated.

The simplest way is to write it to a file somewhere. Goes like this (using the desktop for the example, but you can put it anywhere you like)

set myData to "Hi There"
set myFile to "myData.txt"
set myFilePath to path to desktop as Unicode text
set fileref to open for access myFilePath & myFile with write permission
	set eof of fileref to 0 -- this erases it, don't do it to append
	write myData to fileref
	close access fileref
on error err -- this is to assure that you always close the file.
	close access fileref
	display dialog err
end try

Thanks, but how does line 4 work?