Run Terminal Scripts from Swift in your Mac app — honza dvorsky http://honzadvorsky.com/blog/2015/5/14/run-terminal-scripts-from-swift-in-a-mac-app …
@mjtsai And those are guaranteed to only finish when the whole script has terminated?
-
-
@czechboy0 But note that you can get NSTaskDidTerminateNotification before the last NSFileHandleReadCompletionNotification… -
@mjtsai Hmm. Sorry, I still can't see exactly how to quickly improve the script I have. Maybe fork the gist and show me? :) -
@czechboy0 No time for that at the moment, but maybe I can write a blog post sometime. -
@mjtsai Let me know if you do. Thanks!
-
-
@czechboy0 I guess if you want to be safer you could wait until you also get a NSTaskDidTerminateNotification. -
@czechboy0 As far as I know, that's the best way to do it. I wonder if a script could purposely close its pipes before it finishes?
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
honza dvorsky
Michael Tsai