Launching Application with arguments
Launching Application with arguments
- Subject: Launching Application with arguments
- From: "Yves Peneveyre" <email@hidden>
- Date: Mon, 19 Nov 2001 15:27:45 +0100
Hello the list,
I read the following thread and I extracted some interesting things :
---------
On Thursday, November 15, 2001, at 12:25 PM, Fei Li wrote:
>
Hello all,
>
I tried to launch a application named "abc.app" use NSTask, I write code
>
as follows:
>
NSArray * args = [[NSArray alloc] initWithObjects:@"2", nil];
>
[NSTask launchedTaskWithLaunchPath:@"/Users/feil/Desktop/abc.app"
>
arguments:args];
>
I always get error message:Task create for path abc.app failed.
You need to run the actual executable file, inside of the app wrapper.
Change the path to "/Users/feil/Desktop/abc.app/Contents/MacOS/abc".
----------
Now, I'd like to retrieve the arguments in the launched application.
Ok, I can modifiy the "main(...)" function to get the arguments,
but I'd like to know if there is an other way to do this......
Any idea ?
Thank you in advance.
Best Regards
Yves
----------------------------------------------------------------
Yves Peneveyre direct line : ++41 21 802 5754
Software Engineer fax : ++41 21 802 5751
LooKware development Ltd phone : ++41 21 802 5750
6B, ch du Trisi email: email@hidden
CH - 1028 Priverenges web:
http://www.lookware.ch
----------------------------------------------------------------