1
let imgPath: String = "\(self.tmpDir)captureRegion.png"
//let screencapturePath = NSBundle.mainBundle().pathForAuxiliaryExecutable("/usr/sbin/screencapture")! as String
let task = NSTask()
task.launchPath = "/usr/sbin/screencapture"
task.arguments = ["-i", "-r", imgPath]
task.launch()
task.waitUntilExit()
,它顯示:在輸出「抓屏不能運行兩個交互式屏幕捕獲在一個時間」,和抓屏不工作抓屏:不能運行兩個交互式屏幕捕捉在上面的代碼是在執行時間