Create new document programmatically in Cocoa
I'm wondering i开发者_StackOverflowf it is possible to send a message (programmatically) to a document-based application to create a new document with some special content inside it. I'm creating two applications and the first has to call the second one sending it some data.
I've tried with the Apple Events but it doesn't seem to work.
There are a number of ways to do this. If you control both applications, probably the simplest is to post a notification to the global notification center from one application, and have the other app listen for it. AppleScript is another way, but requires a bit more work to set up.
精彩评论