> I am not asking how to trigger the "read from file" and "write to
> file" events.
Yes, you are.
>I want to know how to insert my own applescript code
> when a user chooses to open or save a file in an xcode applescript
[quoted text clipped - 6 lines]
> that handler to work in the Document.applescript file (or any
> applescript file for that matter)?
Well, do you know how to make it so that when the user clicks a button
in the interface, your "on clicked" handler is called? In Interface
Builder, you check the "clicked" event handler's checkbox in the
AppleScript Inspector for that button, and you make sure to specify that
the event should be routed to the desired script file. (Again, if you
don't know what I'm talking about, see my AppleScript book, which has a
substantial section devoted to AppleScript Studio.)
It's exactly the same for "read from file".
You yourself started by citing the "Plain Text Editor" example. Well,
look at the example! Open Document.nib and examine the File's Owner in
the AppleScript Inspector.
As the docs explain, it usual to enable "data representation" and "load
data representation", and that is how a default AppleScript Document app
comes configured. But you can use "read from file" and "write to file"
instead if you like. m.

Signature
matt neuburg, phd = matt@tidbits.com, http://www.tidbits.com/matt/
Tiger - http://www.takecontrolbooks.com/tiger-customizing.html
AppleScript - http://www.amazon.com/gp/product/0596102119
Read TidBITS! It's free and smart. http://www.tidbits.com
bzohn - 28 Mar 2007 17:55 GMT
> > I am not asking how to trigger the "read from file" and "write to
> > file" events.
[quoted text clipped - 36 lines]
> AppleScript -http://www.amazon.com/gp/product/0596102119
> Read TidBITS! It's free and smart.http://www.tidbits.com
Okay, found it. File's owner is the answer I was looking for. Thanks!