Sean,

So in essence my question is: How can I tell my application to accept iCal events dragged directly from the iCal GUI?

When iCal events are dragged and exported to another application, iCal will provide a promised .ics file in ~/Library/Caches/ TemporaryItems. This file has an extension "ics" and a UTI of com.apple.ical.ics. Ideally, you'd just set the Document Types in your target's properties (Info.plist) to support this file, but it seems a bit tricky since this is a promised file and probably does not have these attributes set yet during the drag.

I didn't have a lot of time to experiment or research how to support promised file drops on the application icon, but one way to make this work is to register a "catch all" document type in Info.plist, and then your application will allow drops of iCal events, although along with it every other kind of file. You can do this in your target's properties window by adding a document type with an extension of "*" and an OS type of "****".

Thanks for the tip. Since indeed it seems that the attributes (UTI etc) are not set yet when the promised file is dragged, I implemented it with the catch-all solution you sketched.

The usability downside of catch-all is that the app icon gets darker (signalling that it accepts a dragged item) with whatever you drag onto it, e.g. folders, pictures, … So if anyone knows a better solution, I'm still interested :-)

Thanks again,
Yang_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to