Reputation: 22820
First-off, let me make clear that what I need it not simple (and obviously what I want is not just to execute another application).
What I need :
Example (though the idea is not 100% clear in my head) :
I don't know if what I am describing is even doable. However, I'd still need to hear your input on this. I've done a lot of research on the matter and though I'm about to base the whole concept of making the host app extendable by external scripts (which get input and serve some output - via php,python,AppleScript,whatever...), this does not cover the case where the "plugin" has its own user interface.
So, any ideas? (An example or some specific reference to point me to would be ideal...)
Upvotes: 0
Views: 162
Reputation: 2080
There's a new API that addresses exactly what you want:
The XPC Services API, part of libSystem, provides a lightweight mechanism for basic interprocess communication integrated with Grand Central Dispatch (GCD) and launchd. The XPC Services API allows you to create lightweight helper tools, called XPC services, that perform work on behalf of your application.
Daemons and Services Programming Guide
There's a good talk on this in the WWDC 2012 videos.
So much of what you describe is indeed possible -- and not necessarily very difficult. However, your "Example" is not -- as you say yourself -- entirely coherent. You want the second application to be separate, but you don't want it to seem "external"; these forces are not fully reconcilable. What you are unlikely to be able to do, for obvious reasons, is to take over an application that's already running on its own. But you can start your own processes.
The usual architecture would be to have several daemons or services doing tasks for you, and one control process that also handles the user interface for everything. Mail, as noted above, works this way.
Upvotes: 2