问题
Is there any way to cancel a running NSUserScriptTask? The only way that comes to mind is to launch a separate process (a command line tool) via NSTask, whose only purpose is to run the NSUserScriptTask, and then terminate the command line tool via NSTask when necessary. However, that seems a bit far-fetched and not very optimized... Any ideas?
来源:https://stackoverflow.com/questions/15599493/nsuserscripttask-cancelling-tasks