Re: handleGetURLEvent getting called after applicationDidFinishLaunching
Re: handleGetURLEvent getting called after applicationDidFinishLaunching
- Subject: Re: handleGetURLEvent getting called after applicationDidFinishLaunching
- From: Jens Alfke <email@hidden>
- Date: Thu, 22 Aug 2013 08:00:20 -0700
On Aug 22, 2013, at 1:34 AM, Uli Kusterer <email@hidden> wrote:
> The notion of one of these being ‘more correct’ than the other is ridiculous. The second case is simply a performance optimization from the classic MacOS days that was carried over to OS X.
Nope. (And not to pull rank, but I was on the AppleEvents/AppleScript team at the time we figured this stuff out [1991] and added the seemingly-useless ‘oapp’ event in response to developer complaints.)
Many apps have a different behavior when launched with no docs/URLs (e.g. the app itself is double-clicked). For example, Apple’s iWork apps open a new-document assistant. The only reliable way an app can tell whether it was launched without a doc/URL is if it gets the ‘oapp’ event instead, and the way that event gets sent is when LaunchServices is told to launch the app but not given any other AppleEvent to launch it with. Thus there is a valuable semantic difference between the two cases.
> Since a GURL Apple Event (which is what is used to send URLs to applications in both cases) can occur at any time, and your app may be already running or may need to be launched to be possible to send an Apple Event to it, you can never rely on a particular order.
Sure, an app has to be prepared to receive ‘odoc' or ‘GURL’ events while running. But that’s a different case from at launch, as I explained.
—Jens
_______________________________________________
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