Re: Quitting all active applications

2008-08-29 Thread Michael Ash
On Thu, Aug 28, 2008 at 1:52 PM, Martin Stoufer [EMAIL PROTECTED] wrote: I had always naively assumed that all the some *Framework underneath an app was setting up signal handlers for you with default behaviours. If this isn't the case, then yes any killall approach will cause loss of data.

Quitting all active applications

2008-08-28 Thread Phil Faber
Is there a simple way to quit all running applications? Basically I want to achieve the same result as the first stage of hitting 'shut down' (closing all applications) without actually shutting down the system. Thanks. ___ Cocoa-dev mailing

Re: Quitting all active applications

2008-08-28 Thread Rob Keniger
On 28/08/2008, at 8:36 PM, Phil Faber wrote: Is there a simple way to quit all running applications? Basically I want to achieve the same result as the first stage of hitting 'shut down' (closing all applications) without actually shutting down the system. You could get the launched

Re: Quitting all active applications

2008-08-28 Thread Phil
On Thu, Aug 28, 2008 at 10:36 PM, Phil Faber [EMAIL PROTECTED] wrote: Is there a simple way to quit all running applications? Basically I want to achieve the same result as the first stage of hitting 'shut down' (closing all applications) without actually shutting down the system. What do

Re: Quitting all active applications

2008-08-28 Thread Marcus
28 aug 2008 kl. 12.36 skrev Phil Faber: Is there a simple way to quit all running applications? Basically I want to achieve the same result as the first stage of hitting 'shut down' (closing all applications) without actually shutting down the system. Take a look at the NSWorkspace

Re: Quitting all active applications

2008-08-28 Thread Phil Faber
Yes I agree it could be most annoying in the majority of cases to quit other people's apps! All I'm trying to achieve is a tiny app that only quits open apps and then quits itself; the purpose being when I want to release as much memory and disc space as possible before I run another

Re: Quitting all active applications

2008-08-28 Thread Martin Stoufer
A small app that utilized an NSTask object whose system command would be 'killall -u your short username here -m regex'. Where the regex would probably exclude processes that did not include 'login' or anything 'launchd'. This would keep the reaper from killing your loginwindow process as

Re: Quitting all active applications

2008-08-28 Thread Martin Stoufer
Actually no, since the default kill signal is TERM, apps will be allowed to prompt to save if necessary. This assumes the app is handling that signal properly. We could send KILL or ABRT and that would just end the processes w/o any save options. Randall Meadows wrote: On Aug 28, 2008, at

Re: Quitting all active applications

2008-08-28 Thread Clark Cox
GUI applications do not generally handle SIGTERM (or any other signals for that matter). Killing GUI applications is a Bad Thing™ :) Randal is correct, this will lose your saved data in any currently open applications. On Thu, Aug 28, 2008 at 10:39 AM, Martin Stoufer [EMAIL PROTECTED] wrote:

Re: Quitting all active applications

2008-08-28 Thread Jean-Daniel Dupas
Cocoa Application expects a Quit AppleEvent, not a sigterm. SIGTERM will kill the app and it will not have any chance to save the edited document. Try with TextEdit if you don't belive it ;-) Actually no, since the default kill signal is TERM, apps will be allowed to prompt to save if

Re: Quitting all active applications

2008-08-28 Thread Randall Meadows
On Aug 28, 2008, at 11:39 AM, Martin Stoufer wrote: Actually no, since the default kill signal is TERM, apps will be allowed to prompt to save if necessary. This assumes the app is handling that signal properly. We could send KILL or ABRT and that would just end the processes w/o any save

Re: Quitting all active applications

2008-08-28 Thread Martin Stoufer
I had always naively assumed that all the some *Framework underneath an app was setting up signal handlers for you with default behaviours. If this isn't the case, then yes any killall approach will cause loss of data. Now I'm interested into finding out why this isn't the case. Clark Cox

Re: Quitting all active applications

2008-08-28 Thread Shawn Erickson
On Thu, Aug 28, 2008 at 9:37 AM, Phil Faber [EMAIL PROTECTED] wrote: All I'm trying to achieve is a tiny app that only quits open apps and then quits itself; the purpose being when I want to release as much memory and disc space as possible before I run another memory / processor intensive

Re: Quitting all active applications

2008-08-28 Thread Sherm Pendley
On Thu, Aug 28, 2008 at 12:37 PM, Phil Faber [EMAIL PROTECTED] wrote: All I'm trying to achieve is a tiny app that only quits open apps and then quits itself; the purpose being when I want to release as much memory and disc space as possible before I run another memory / processor intensive

Re: Quitting all active applications

2008-08-28 Thread Ken Thomases
On Aug 28, 2008, at 4:53 PM, Sherm Pendley wrote: On Thu, Aug 28, 2008 at 12:37 PM, Phil Faber [EMAIL PROTECTED] wrote: All I'm trying to achieve is a tiny app that only quits open apps and then quits itself; the purpose being when I want to release as much memory and disc space as