• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Cocoa GUI app invocation from CLI with arguments
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa GUI app invocation from CLI with arguments


  • Subject: Re: Cocoa GUI app invocation from CLI with arguments
  • From: Jean-Daniel Dupas <email@hidden>
  • Date: Tue, 1 Apr 2008 00:31:41 +0200


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:
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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Cocoa GUI app invocation from CLI with arguments
      • From: "Mac QA" <email@hidden>
References: 
 >Cocoa GUI app invocation from CLI with arguments (From: "Mac QA" <email@hidden>)

  • Prev by Date: Re: Simple menu-action question
  • Next by Date: Re: linked list problem
  • Previous by thread: Cocoa GUI app invocation from CLI with arguments
  • Next by thread: Re: Cocoa GUI app invocation from CLI with arguments
  • Index(es):
    • Date
    • Thread