I'm working on a Cocoa application into which I'd like to allow Mail messages to be dropped.
If I include public.plain-text
in my Info.plist Document Types, I can drop a Mail message on the icon in the Dock and get a file path like this from the application:openFiles:
delegate method:
"/Users/smokris/Library/Caches/TemporaryItems/Re_ multiplexer question 3.eml"
...and I can read the raw message data from this file. So far so good.
However, I also want the user to be able to drop Mail messages on the application window. So I do this:
[window registerForDraggedTypes:[NSArray arrayWithObjects:(NSString *)kPasteboardTypeFileURLPromise,nil]];
...and in performDragOperation:
, I get a URL like this from the pasteboard:
message:%3CAANLkTikeTeWYU39JpTovxF2PC0Mm=xkrU7fHNh6gGh6V@mail.gmail.com%3E
If I try doing an NSURLRequest
on this URL, it gives me the error "unsupported URL".
How can I get the raw message data from this message:
URL?