Hi guys, I am fairly new to cocoa and objective-c but I wiggled my way through so far. But here is a one that I really need some help with:
I am trying to launch an application with NSTask and pass some arguments. Usually I do this from the terminal and a command would look like this:
render -start 1 -end 50 myFile.XY
The problem is that NSTask launches the application (render) in the desired application path but then only continues to work there with the filename (myFile.XY) and ignores all the flags that come after the command.
I have tried everything so far (from my point) and I would just like to kind of open terminal, write my command string and then execute. There must be some way of doing this, because I have seen it working in other apps.
My code looks like this so far:
NSTask *task;
task = [[NSTask alloc] init];
[task setLaunchPath: @"/usr/sbin/render"];
NSArray *arguments;
arguments = [NSArray arrayWithObjects: @"render -s 1 -e 2 redBall.ma", nil];
[task setArguments: arguments];
[task launch];
I appreciate any help or comments on this.
Cheers, Ingo
I am trying to launch an application with NSTask and pass some arguments. Usually I do this from the terminal and a command would look like this:
render -start 1 -end 50 myFile.XY
The problem is that NSTask launches the application (render) in the desired application path but then only continues to work there with the filename (myFile.XY) and ignores all the flags that come after the command.
I have tried everything so far (from my point) and I would just like to kind of open terminal, write my command string and then execute. There must be some way of doing this, because I have seen it working in other apps.
My code looks like this so far:
NSTask *task;
task = [[NSTask alloc] init];
[task setLaunchPath: @"/usr/sbin/render"];
NSArray *arguments;
arguments = [NSArray arrayWithObjects: @"render -s 1 -e 2 redBall.ma", nil];
[task setArguments: arguments];
[task launch];
I appreciate any help or comments on this.
Cheers, Ingo