Terminating Another App Running - Cocoa
问题 How can I terminate another app that is running in cooca. Let's say I have iTunes running, and I type in quit in my app, it would quit itunes. "iTunes" is just an example, it could be anything the user wants. I can open any app from my application, but I want to know how to close any app running. thanks kevin 回答1: If you're running on Mac OS X 10.6, Snow Leopard, you can use the new NSRunningApplication terminate method. 回答2: AppleScript is a pretty high-level way to send a single Quit event.