Re: Calling cocoa app from command line
Re: Calling cocoa app from command line
- Subject: Re: Calling cocoa app from command line
- From: Patrick Hartling <email@hidden>
- Date: Thu, 15 Mar 2007 17:12:50 -0500
Is there a way for an application to bring itself forward programmatically
to get the same result as using 'open' or by double-clicking on the icon?
-Patrick
John Stiles wrote:
> Also, when running an app directly from the command line, it does not
> bring itself forward automatically. It will show up in the back, behind
> other running apps.
>
> On Mar 15, 2007, at 2:52 PM, Clark Cox wrote:
>
>> On 3/14/07, Mark Ritchie <email@hidden> wrote:
>>> On 14-Mar-07, at 3:47 PM, Daryl Thachuk wrote:
>>> > Look at 'open'
>>>
>>> or if you know the path to the application then launch it directly:
>>> .../MyApp.app/Contents/MacOS/MyApp
>>
>> Just an FYI to the OP. These will result in very different running
>> environments for your program, and would be desirable in different
>> situations.
>>
>> 'open' will open the application just as double clicking on it would
>> have. This means that if an instance of your app is already running,
>> it will simply be reactivated (i.e. open will not start a new instance
>> of your application)
>>
>> Running it directly from the command-line (i.e. the second suggestion
>> above) will run it as a subprocess of your shell. This means that it
>> will inherit your shell's environment, and will have its stdin/out
>> attached to the same files as the shell itself, etc. *and* it will not
>> reactivate an already running instance of your app.
>>
>>
>> --Clark S. Cox III
>> email@hidden
--
Patrick L. Hartling | VP Engineering, Infiscape Corp.
PGP: http://tinyurl.com/2oum9 | http://www.infiscape.com/
Attachment:
signature.asc
Description: OpenPGP digital signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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