1

I'm trying to make a tiny OS X app that would start a bash script on-demand and print its output in a text field, but not its result after its completion, its result while it runs.

It'll be just a simple app with one start/stop button.

Any ideas of how I could do this?

Thanks a lot!

Tommy B.
  • 3,591
  • 14
  • 61
  • 105

1 Answers1

2

Take a look at the answers on SO here or just read documentation for classes NSTask and NSPipe

Just edited my answer to make it a little more clear:

the idea is to add a notification (NSFileHandleDataAvailableNotification) on the NSFileHandle returned by the NSPipe method fileHandleForReading.

Hope this helps =)

Community
  • 1
  • 1
GreyHands
  • 1,734
  • 1
  • 18
  • 30