I'm using NSUserScriptTask to run scripts the user placed in the Application Scripts directory. However, I'm finding it hard to find out which are the known types of scripts that NSUserScriptTask accepts and the docs don't help much either... Any ideas?
So far I've tried these:
- .sh
- .applescript
- .scpt
- .scptd
- .txt
And coudn't get any of them to work (the initWithURL:error:
method returns nil)
EDIT: I forgot to include the error! Silly me... Here's what gets printed on the log:
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}