Quitting an application
Quitting an application
- Subject: Quitting an application
- From: Kent Sutherland <email@hidden>
- Date: Wed, 8 May 2002 18:34:28 -0400
I'm trying to make my application quit System Preferences without having
to use too much code, and I haven't seen a Cocoa way of doing it.
I've tried doing: [NSTask launchedTaskWithLaunchPath:@"/bin/kill"
arguments:[NSArray arrayWithObject:@"`ps -auxww | grep System\\
Preferences | grep -v grep | grep $LOGNAME | awk '{print $2}'`"]];
But it hasn't worked, as it sends the whole argument to be killed
instead of processing it first. I don't want to have to make a task that
runs ps aux and then kills with that returned value, because that's
overkill it seems. Is there an easy way to use AppleScripts "do shell
script" command in Cocoa easily?
Any help would be appreciated, thanks!
Kent Sutherland
_______________________________________________
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.