Cocoa run AppleScript that already contains double quotes
问题 I have a Cocoa application that need admin permission to execute a cmd, but in some extreme case like filename containing double quote, this code does not work. NSString *fileName = @"~/Documents/My\" File/"; NSString *cmd = [NSString stringWithFormat:@"chown -R '%@' '%@';NSUserName(), fileName]; NSString *cmd_execute = [NSString stringWithFormat:@"do shell script \"%@\" with administrator privileges",cmd_execute]; //This line is the problem, our %@ contains double quote, so cocoa //cannot