• 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: Launching a GUI app from a daemon?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Launching a GUI app from a daemon? (From: Steve Herman <email@hidden>)
 >Re: Launching a GUI app from a daemon? (From: "Mike T. Miller" <email@hidden>)

  • Prev by Date: NSTableView reloadData not working?
  • Next by Date: Re: [Now OT] Re: Tunneling mouse events through windows?
  • Previous by thread: Re: Launching a GUI app from a daemon?
  • Next by thread: Network-based data source for NSOutlineViews
  • Index(es):
    • Date
    • Thread