[Pythonmac-SIG] appscript and launching apps from "background-only" Python processes
Bill Janssen
janssen at parc.com
Wed Oct 29 17:58:25 CET 2008
Ned Deily <nad at acm.org> wrote:
> In article <11040.1225240345 at parc.com>, Bill Janssen <janssen at parc.com>
> wrote:
>
> > I'm starting a Python daemon using SystemStarter, and in it I'm using
> > appscript to launch an app (Entourage). I get the following error:
> >
> > CantLaunchApplicationError: CantLaunchApplicationError -606: Application is
> > background-only.
> >
> > If I start the same daemon from the command-line manually, it works
> > fine. I'm guessing that some environment variable is not being set by
> > SystemStarter, which is what makes it "background-only". Can anyone
> > shed some light on this?
>
> I suspect the issue is that processes started by SystemStarter are not
> "connected" to the windowserver and are running as root so attempts to
> launch Carbon or Cocoa gui apps will fail. Tech note 2083 has a lot of
> details about this and the perils of launching gui apps from daemons:
>
> <http://developer.apple.com/technotes/tn2005/tn2083.html>
Actually, the process is running under a regular user user-id, and only
attempts to launch Entourage (to read the user's address book) when that
user is logged in. The use case is kosher; what I need is a way to tell
the system that.
Bill
More information about the Pythonmac-SIG
mailing list