When launching Path Finder app with command line, I use open -a Path Finder.app /Users/
.
Based on this idea, I use the following code to launch Path Finder.
Can I have launch app without using open
command line?
NSTask *task;
task = [[NSTask alloc] init];
[task setLaunchPath: @"/usr/bin/open"];
NSArray *arguments;
arguments = [NSArray arrayWithObjects: @"-a", @"Path Finder.app", @"/Users/", nil];
[task setArguments: arguments];
NSPipe *pipe;
pipe = [NSPipe pipe];
[task setStandardOutput: pipe];
NSFileHandle *file;
file = [pipe fileHandleForReading];
[task launch];
With Parameters:
You could also use NSTask to pass arguments: