Re: Launching a GUI app from a daemon?
Re: Launching a GUI app from a daemon?
- Subject: Re: Launching a GUI app from a daemon?
- From: Brian Christensen <email@hidden>
- Date: Mon, 24 Nov 2003 16:48:16 -0500
You could try using the "osascript" command to tell the app to quit via
AppleScript.
/brian
On Nov 24, 2003, at 3:50 PM, Mike T. Miller wrote:
You can launch a GUI app by using fork/exec with the "open" command.
That's the easy bit. Killing the app from the daemon is a bit
trickier: the pid you have access to in your daemon is for the "open"
process, not the app, and, alas, "open" returns without waiting for
the app to die.
I think you will have to communicate with the shared workspace
(returned from NSApplication) and find out the
NSApplicationProcessIdentifier so that you can kill it. If there is
an easier way to do this, I'd love to hear it.
-mike
On Nov 24, 2003, at 12:13 PM, Steve Herman wrote:
Can anyone offer any good advice or techniques for launching a GUI
application from a daemon?
The daemon is currently a C program and is not linked with any of the
Carbon/Cocoa frameworks. Are there Unix calls that would fit best for
this situation, or should I look at making the daemon link with the
Foundation framework and use NSTask... or link with Carbon and use
LaunchServices?
The daemon will need to be able to kill the GUI app at certain times
as well if that makes any difference.
--
+-------------------------------------------------------+
| Steve Herman |
| Macintosh Software Development and Support |
| Lockheed Martin Information Technology NASA-ODIN |
| 102 Research Blvd, Bldg 2 |
| Madison, AL 35758 (voice) 256 319-2869 |
| mailto:email@hidden (fax) 256 319-2984 |
+-------------------------------------------------------+
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
--
Mike T. Miller
Sr. Java Architect, NorCal Software Services
Sun Microsystems, Inc.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.