Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa GUI app invocation from CLI with arguments




You can get cli arguments at anytime using NSProcessInfo.

- [[NSProcessInfo processInfo] arguments];

So just get them in -applicationDidFinishLaunching or in -awakeFromNib and do what you need with them.


Le 1 avr. 08 à 00:18, Mac QA a écrit :

Hi,

In the past I have written a few little Cocoa programs that when
double-clicked are opened in GUI mode, or can also be invoked from the
CLI by passing in a few arguments. In those situations when invoking
from the CLI I never actually displayed a GUI, but just performed the
same core functionality w/o a GUI. However, now I have the situation
of having a pre-existing GUI app that I would like to add a CLI
interface to. What is different is that I want to pass the CLI
arguments into the text fields of the GUI, not just use the values to
start executing some core functionality. I am unclear how to
accomplish this. Can anyone suggest how, when invoked from the CLI, I
can throw up my existing GUI and then fill in the values from the CLI
into the corresponding fields of the GUI. Any suggestions are
appreciated. Thanks!
_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden

_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Cocoa GUI app invocation from CLI with arguments (From: "Mac QA" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.