Re: handleGetURLEvent getting called after applicationDidFinishLaunching
Re: handleGetURLEvent getting called after applicationDidFinishLaunching
- Subject: Re: handleGetURLEvent getting called after applicationDidFinishLaunching
- From: Kyle Sluder <email@hidden>
- Date: Thu, 22 Aug 2013 09:00:08 -0700
On Aug 22, 2013, at 8:00 AM, Jens Alfke <email@hidden> wrote:
>
> 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.
In your example, the difference doesn't matter. If the app is sitting at the new doc assistant, or has a default blank document open, it should close that assistant or document and open the one requested via URL. Apps have been doing this for decades.
--Kyle Sluder
_______________________________________________
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