Some applications (especially file transfer apps) allow you to spawn an external text editor in order to edit a remote file. They do this by downloading the file to a temporary directory, opening the external editor with this file, and then monitoring for changes to the file and/or the application state (e.g. when it quits) and use these as triggers to upload the modified file to the remote server.
I would like to implement similar functionality (specifically using AppleScript Editor, though I would like to understand the general case) - what is a good way to go about doing so in Objective-C/Cocoa?
What are some of the potential pitfalls I should avoid? I imagine catching a save halfway through would cause some issues...?
I'm familiar with Objective-C through iOS programming, but have only just started with Cocoa.