Using Terminal within Cocoa App.
Using Terminal within Cocoa App.
- Subject: Using Terminal within Cocoa App.
- From: Caroline <email@hidden>
- Date: Wed, 16 Jan 2008 17:25:04 +0900
- Importance: normal
Hello world,
I want to run some App by using Terminal script.
My Cocoa App can run Terminal by using NSTask as follow.
NSTask *task = [[NSTask alloc] init];
NSPipe *pipe = [NSPipe pipe];
[task setStandardOutput:newPipe];
[task setLaunchPath:@"/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal"];
[task setArguments:[NSArray arrayWithObjects:[NSString stringWithFormat:@"cd %@", someApp_Path],nil]];
[task launch];
I expect to set Terminal command "cd Path..." (ex. cd /Users/Desktop/...), and excute the someApp,
but there is no event.
How can I develop my Cocoa App to set automatically Terminal command, and someApp executes?
Is it impossible?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden