• 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: exec(uting) Safari - How (newbie)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: exec(uting) Safari - How (newbie)


  • Subject: Re: exec(uting) Safari - How (newbie)
  • From: Jason Coco <email@hidden>
  • Date: Wed, 2 Jul 2008 11:44:08 -0400


On Jul 2, 2008, at 11:36 , Jean-Daniel Dupas wrote:


Le 2 juil. 08 à 16:58, Jason Coco a écrit :

Yeah, to me it is... although I still agree that it's not an ideal solution for a Cocoa application...

By the way, assuming you change char *args[] = { "-a", "Safari", NULL }; to char *args[] = { "/usr/bin/open", "-a", "Safari", NULL }; the exec* example actually works while the LaunchServices example fails with kLSApplicationNotFoundError.


Mail is not a very good IDE ;-)

Nope, not at all :)


After playing around with it a little, I discovered that you need to actually call it CFSTR("Safari.app") in this case to get it to work correctly... so like anything else in life, since I'm much more familiar with the POSIX/BSD API (and since pretty much every operating system I've ever worked with treats exec* similar) it's a lot easier *for me* than using LaunchServices.

OK.

In fact, I never use LS with app name but with bundle ID instead. It's far more reliable.

LSFindApplicationForInfo(kLSUnknownCreator, CFSTR("com.apple.Safari"), NULL, &app, NULL)


That's actually really useful to know... by the way, I'm not actually convinced that the OP knows that exec* is gonna terminate his application...

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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

References: 
 >exec(uting) Safari - How (newbie) (From: "Barrie Green" <email@hidden>)
 >Re: exec(uting) Safari - How (newbie) (From: Kristopher Matthews <email@hidden>)
 >Re: exec(uting) Safari - How (newbie) (From: Jason Coco <email@hidden>)
 >Re: exec(uting) Safari - How (newbie) (From: "Kyle Sluder" <email@hidden>)
 >Re: exec(uting) Safari - How (newbie) (From: Kevin Elliott <email@hidden>)
 >Re: exec(uting) Safari - How (newbie) (From: "Kyle Sluder" <email@hidden>)
 >Re: exec(uting) Safari - How (newbie) (From: Jason Coco <email@hidden>)
 >Re: exec(uting) Safari - How (newbie) (From: Jean-Daniel Dupas <email@hidden>)
 >Re: exec(uting) Safari - How (newbie) (From: Jason Coco <email@hidden>)
 >Re: exec(uting) Safari - How (newbie) (From: Jean-Daniel Dupas <email@hidden>)

  • Prev by Date: Re: exec(uting) Safari - How (newbie)
  • Next by Date: Re: exec(uting) Safari - How (newbie)
  • Previous by thread: Re: exec(uting) Safari - How (newbie)
  • Next by thread: Re: exec(uting) Safari - How (newbie)
  • Index(es):
    • Date
    • Thread