I am trying to figure out how to accept emails that the user drags from
Outlook for Mac onto my application.
These emails can be dragged and dropped easily into any Finder directory
(with Outlook it works similarly to Apple Mail), however, unlike Mail, I am
unable to figure out how this mechanism works.

In Mail.app I can accept dragged files by implementing this method:

- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender {
[sender namesOfPromisedFilesDroppedAtDestination:[NSURL fileURLWithPath:
@"/Users/Nick/Desktop/dirtosavefiles"]];
return YES;
}

And, whenever I drag a file, files are saved into this specified directory:
dragging source "promises" that it will store file, and the dragging
destination instructs the source where to store files via
namesOfPromisedFilesDroppedAtDestination.

However, when I am calling namesOfPromisedFilesDroppedAtDestination with
Outlook, this method returns nil, and nothing gets saved into that
directory.

I checked with the Clipboard Viewer what pasteboard types are available
during drag and drop operation with Outlook. It turns out, among others
there are com.apple.pasteboard.promised-file-content-type (which has a
string value of "com.apple.mail.email") and
com.apple.pasteboard.promised-file-url, which is empty.
On the other hand, If I drag'n'drop from Apple Mail.app to the desktop,
Clipboard Viewer shows that com.apple.pasteboard.promised-file-url contains
the full path to the saved file.

For both, Apple Mail and MS Outlook for Mac, "Apple files promise
pasteboard type" type has a property list inside, with an array and a
single entry "eml":
<array>
<string>eml</string>
</array>

What am I missing? How to accept a dragged Outlook email with my app? I
believe Outlook uses promised files when emails are being dragged, but how
to access them?

Thanks!
_______________________________________________

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

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

Reply via email to