• 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
Quitting an application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Quitting an application
      • From: Nicholas Riley <email@hidden>
    • Re: Quitting an application
      • From: email@hidden
  • Prev by Date: NSOpenGLView inside NSScrollView query
  • Next by Date: Drawing on the back of an NSWindow
  • Previous by thread: Re: NSOpenGLView inside NSScrollView query
  • Next by thread: Re: Quitting an application
  • Index(es):
    • Date
    • Thread