Search code examples
cocoaterminalffprobe

Calling a Terminal Command from a Cocoa Application


  1. I created a Cocoa Mac OSX application in XCode
  2. Added a Button to the view
  3. While running the application, if i click the Button
  4. A terminal command for example "ffprobe abcd.avi" should be called and the results should be passedback to the cocoa application

Is that possible?


Solution

  • Use NSTask. You can find some simple examples of using it here: http://borkware.com/quickies/one?topic=nstask