[launchd-dev] Running my application on event: another application's start

eveningnick eveningnick eveningnick at gmail.com
Sun Oct 3 07:14:03 PDT 2010


Hello!
I am no sure if it is a right list to post this message. Sorry if not :)

How could i implement the subj? What i need to do  - is to launch a
"plugin process" (ordinary cocoa application, written by me) when the
host application (ordinary carbon application, Microsoft Word) starts,
i.e. when the user launches it from the dock, or doubleclicks on any
*.docx icon in finder.
On other lists I've been told to use launchd, but it turns out that
Launchd doesn't support events like watching another  application
start, so i am curious if someone has implemented something similar,
and how can it be implemented.
"Who" in OS X can give me a notice, that a new process with name
"Microsoft Word" has been launched? So far i see the solution like an
agent, that is started with the system start, and which somehow pulls
"ps" command in forevercycle, watching for "Microsoft Word" to appear
in the list. If it word is started - this agent starts my plugin. If
not - it continues pulling "ps".
Maybe there's more sane way to perform that, something more "neat" and
something that wouldn't irritate user.
Thanks a lot for any advice
George


More information about the launchd-dev mailing list