Apple event for "open contents": re-entry and multiple qualifying services
Apple event for "open contents": re-entry and multiple qualifying services
- Subject: Apple event for "open contents": re-entry and multiple qualifying services
- From: Daryle Walker <email@hidden>
- Date: Fri, 12 Sep 2014 13:37:36 -0400
I’m looking at <https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/ScriptableCocoaApplications/SApps_handle_AEs/SAppsHandleAEs.html#//apple_ref/doc/uid/20001239-1121328>.
1. So -applicationDidFinishLaunching: is called every time this service is needed? Looking at sample code, it seems most apps assume this function is called exactly once, and is preferred over the “will” version. Now, I’m currently using the “will” version, since initial Apple events are called between the two methods so any setup opening/printing actions need has to be in the “will” version, and have no “did” version. If I do add a “did” version, I have to either omit or protect any code that should be called exactly once, right? But, what does the “takes place after event handling” part mean? Is it still called only once, after all?
2. Doing the action involves calling the Carbon handler. The legacy docs mention calling the service that can handle the appropriate data type. But the prose acts like either you have an appropriate handler or you don’t. But I’ve been looking over the Services docs, and you can have multiple services, even multiple handlers for the same data type! The doc writers, or worse the API writers, sloppily didn’t consider that case. Is there a secret dictionary key to indicate which service to use? Do the system pick the first one? Or would the writers punt and insist that programmers forfeit the automatic handling and write an Apple event override for the open-contents event? (And Apple’s writers need to add that case.)
—
Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT mac DOT com
_______________________________________________
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