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

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -