我正在使用NSUserScriptTask來運行用戶放置在應用程序腳本目錄中的腳本。但是,我發現很難找出哪些是NSUserScriptTask接受的已知類型的腳本,並且docs也沒有多大幫助......任何想法?NSUserScriptTask:接受的文件類型?
到目前爲止,我已經嘗試了這些:
- .SH
- .applescript
- .scpt
- .scptd
- .TXT
而且coudn't讓他們中的任何人工作(initWithURL:error:
方法返回零)
編輯: 我忘了,包括錯誤!我傻......這裏就是被印上的日誌:
Error Domain=NSCocoaErrorDomain Code=259 "The file 「Untitled.applescript」 couldn’t be opened because it isn’t in the correct format." UserInfo=0x100121f50 {NSURL=file://localhost/Users/path to file/Untitled.applescript, NSFilePath=/Users/path to file/Untitled.applescript}
你是什麼意思是「不能讓他們...的工作」? – 2013-03-24 20:44:17
@PeterHosey我更新了錯誤,我得到的問題 – Alex 2013-03-24 21:15:06