Part of the Samples Website. 8/16/97.


«this script adds two lines at the beginning of a text file
local (f = "Macintosh HD:testfile")
local (origcreator = file.creator (f))
local (origtype = file.type (f))
local (origcreationdate = file.created (f))
local (s) (f)
s = string ( (f, infinity))
file.close (f)
s = "line 1\r" + "line2\r" + s (f)
file.setType (f, origtype)
file.setCreator (f, origcreator)
file.setCreated (f, origcreationdate) (f)
file.write (f, s)
file.close (f)

This page was last built on Sat, Aug 16, 1997 at 6:43:14 PM. You can download the current set of sample scripts from our FTP site. Dave