Hello,
I’ve spent the better part of today trying to get a shell command to run from within my application but without stalling the UI while the script is executing. I’ve read (https://secure.macscripter.net/viewtopic.php?id=31541) that NSTask might be able to help me with this, but I’m having a hard time getting it to work.
I would like to replace this:
do shell script "cd " & pathToMePosix & " && ./" & videoPlugin & space & "\"" & romPath & "\""
with something like this:
tell class NSTask of current application
set arraylist to {"Users/john/Desktop/wonderful.sh"}
set theTask to (NSTask's alloc)'s init()
theTask's setLaunchPath_("/bin/sh/")
theTask's setArguments_(arraylist)
theTask's |launch|()
end tell
where “wonderful.sh” would contain something like the above shell script. I can’t seem to get it to work, though. Can someone point me in the right direction?
Thank-you.
Model: MacBook Pro 13"
Browser: Safari 531.21.10
Operating System: Mac OS X (10.6)