I have played around with trying to write data to a text edit document before and anyway this is what’s going on. I can open for access a file, read the file and apparently write to the file, but if I try to open that file with text edit it says that the file is corrupt or some such and cannot open the file. Is this normal? I got to playing around with this again while experimenting with things in the standard additions dictionary. It wasn’t too long ago (from a post here) that I even knew that this existed (eventhough I have been using elements from there for a while). Here’s the code.
set theFile to choose file
try
open for access theFile with write permission
end try
set theText to read theFile from 185.55 for 300 -- another question comes in here. The dictionary says that these numbers should be double integers? Just what does that mean. (Unless I have forgotten what an integer is I don't believe 185.55 is one but this does not throw an error.)
set x to get eof theFile
display dialog x as string
set theString to "This is the place where I tried entering stuff into this file."
write theString to theFile starting at x
close access theFile
display dialog (summarize theText) with title "The Summary" buttons {"Ok"}
Also, while I’m at it, the text that is read in (from the event log) contains a whole lot of stuff before the actual text that I entered. How do I know where the beginning of the text that I entered (and want to use) actually is? (I’ll look in text edit dictionary, but just incase. . .)
Thanks to all!
PreTech
Model: dual 1.8 G5
AppleScript: 2.1 (80)
Browser: Safari 412.5
Operating System: Mac OS X (10.4)