开发者

Create new document programmatically in Cocoa

开发者 https://www.devze.com 2022-12-22 11:31 出处:网络
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 tw

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消