• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: launchd detecting when an application is running
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: launchd detecting when an application is running


  • Subject: Re: launchd detecting when an application is running
  • From: Jerry Krinock <email@hidden>
  • Date: Thu, 4 Jun 2009 08:51:36 -0700


On 2009 Jun 04, at 08:40, Todd Heberlein wrote:

I have written an application that I would like to launch whenever a certain app is launched. I have used LaunchAgents in the past to detect events such as USB insertion and volume mounting to perform certain actions. I was wondering if there was a launchd.plist key that allowed for launchd to detect an application startup.

One approach is to have an agent monitor the audit trail to look for the application starting. The agent can then do something that can cause your app to launch, but now you are introducing a third program into the mix.

Yup. I have an app which needs to know when other apps (not mine) quit. So, I wrote a silly little agent, kept alive by launchd, that registers for NSWorkspaceDidTerminateApplicationNotification, starts a run loop, then sits and waits. Haven't field-tested yet, but seems to work. It's confusing, though!


What do you mean by "audit trail"?

It would be nice if launchd had this capability, but as Kyle said, that is by design not one of the things that it does.

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >launchd detecting when an application is running (From: Tom Hohensee <email@hidden>)
 >Re: launchd detecting when an application is running (From: Dave Keck <email@hidden>)
 >Re: launchd detecting when an application is running (From: Tom Hohensee <email@hidden>)
 >Re: launchd detecting when an application is running (From: Todd Heberlein <email@hidden>)

  • Prev by Date: Re: launchd detecting when an application is running
  • Next by Date: Re: launchd detecting when an application is running
  • Previous by thread: Re: launchd detecting when an application is running
  • Next by thread: Re: launchd detecting when an application is running
  • Index(es):
    • Date
    • Thread