I am trying to run an AppleScript from my app which is sandboxed. I have got the user's consent(NSOpenPanel) to root directory so the app has permission to ready anything. I am not able to run any script, even a simple one like echo 'hellow world'. I tried to run it on the main thread with dispath_async(or performselectoronmainthread) but without success. The script part is as below :
NSString *zipScript = [NSString stringWithFormat:@"do shell script \"echo 'hello world'\""];
NSAppleScript *script = [[NSAppleScript alloc] initWithSource:zipScript];
NSDictionary *error2;
[script executeAndReturnError:&error2];
if(error2)
{
return false;
}
Full description of error2 is (i have removed the app's name) :
{
NSAppleScriptErrorAppName = "XXXXXXXX";
NSAppleScriptErrorBriefMessage = "The command terminated due to receipt of a signal.";
NSAppleScriptErrorMessage = "The command terminated due to receipt of a signal.";
NSAppleScriptErrorNumber = 1011;
NSAppleScriptErrorRange = "NSRange: {0, 170}";
}
Is there any reason/solution for this error?
Thanks in advance.