Open a terminal window to a specified folder from a Cocoa app
问题 I have seen this thread on how to execute terminal commands from within a Cocoa app. But I want to actually launch Terminal.app to a specified directory. I know that the following does not work: [[NSWorkspace sharedWorkspace] openFile:folderPath withApplication:@"Terminal"]; Terminal tries to actually open the folder as a file. Is this something I have to use AppleScript for? Any ideas? 回答1: You could use AppleScript from Cocoa like this: NSString *s = [NSString stringWithFormat: @"tell