can a script contain a file?

I did not know if this is possible. can a script create a database? Lets say it keeps track for some variables. Can it create a file and then store updateable variables/data? Also, can a script store a file, like a picture? Lets say I have an app I created that a friend needed. I want a specific pic to be used and contained in the app. Are these things possible?

You should never store data inside a program or script. Create files inside the user’s Library or Documents folder instead.

If you save your script as an application bundle you can then put files in its resources folder by control-clicking your application and choosing ‘show package contents’. You can reference files inside your application bundle by using ‘path to me’ and suffixing the relative path inside your bundle.

This thread shows an alternative (hhas) for storing data as a preference record. I’ve used it with great success.

http://bbs.applescript.net/viewtopic.php?id=15581