Sorry, english is not my first language, and I have a poor grammar skill.
Hi, I am a developer that is very new to Objective-C, and I have some problems with using NSTask. I have a .command file that I want to execute in this cocoa application, but if I use the "open" command using NSTask to execute the file, it launches terminal. Is there a way to just execute it without launching it, like a typical NSTask? Or can I just have a text file with the command to be executed? Thank You.
Here is my code...
NSString *pathtorb = [[NSBundle mainBundle] pathForResource:@"rightSpace" ofType:@"command"];
NSTask *DfileBlankSpace = [[NSTask alloc]init];
DfileBlankSpace.launchPath = @"/usr/bin/open";
DfileBlankSpace.arguments = @[pathtorb];
[DfileBlankSpace launch];
[DfileBlankSpace waitUntilExit];
NSTask *killDock = [[NSTask alloc]init];
killDock.launchPath = @"/usr/bin/killall";
killDock.arguments = @[@"Dock"];
[killDock launch];
[killDock waitUntilExit];