osx - How to use NSTask in Swift -
i having bit of trouble nstask() in swift (for os x application). can post snippet of code in swift uses nstask() correctly? thank you!
create task…
let task = nstask() select path…
task.launchpath = "/usr/bin/say" pass arguments command…
task.arguments = ["i'm guybrush threepwood, mighty pirate!"] launch task, , block current thread until it's done…
task.launch() task.waituntilexit()
Comments
Post a Comment