Note that there are some explanatory texts on larger screens.

plurals
  1. PODrop e-mail from mail.app into NSWindow object
    primarykey
    data
    text
    <p>I have an cocoa app where I would like to accept e-mails from mail.app dragged into the main window of the app. I have in my applicationDidFinishLaunching: </p> <pre><code>[_window registerForDraggedTypes: [NSArray arrayWithObjects: NSFilenamesPboardType, (NSString *)kPasteboardTypeFileURLPromise, nil]]; //kUTTypeData [_window setDelegate:(id) self]; </code></pre> <p>This works fine, I can receive a document, in my performDragOperation: using</p> <pre><code>NSArray * files = [sender namesOfPromisedFilesDroppedAtDestination:url]; </code></pre> <p>However, this only lets me drag the emails one-by-one. If I mark several emails, everything seems OK until I drop, then nothing happens. The performDragOperation is not even called. </p> <p>I have tried to add kUTTypeData to the registerForDraggedTypes..., and then I get the performDragOperation... called, but then I cannot use the namesOfPromisedFilesDroppedAtDestination:url as it returns a nil pointer. </p> <p>When I had the kUTTypeData included in the register... I included this in the performDragOperation to see what types in drag: </p> <pre><code>pboard = [sender draggingPasteboard]; NSLog(@"perform drag entered, %@", [pboard types]); </code></pre> <p>With the following result: </p> <pre><code>2013-07-25 15:09:50.771 BO2ICAL[1672:303] perform drag entered, ( "dyn.ah62d4rv4gu8y4zvanr41a3pwfz30n25wqz4ca5pfsr30c35feb4he2pssrxgn6vasbu1g7dfqm10c6xeeb4hw6df", "MV Super-secret message transfer pasteboard type", "dyn.ah62d4rv4gu8zg7puqz3c465fqr3gn7bakf41k55rqf4g86vasbu1g7dfqm10c6xeeb4hw6df", "Super-secret Automator pasteboard type" ) </code></pre> <p>While the list for single e-mails are: </p> <blockquote> <p>2013-07-25 15:14:30.096 BO2ICAL[1672:303] perform drag entered, ( "dyn.ah62d4rv4gu8y4zvanr41a3pwfz30n25wqz4ca5pfsr30c35feb4he2pssrxgn6vasbu1g7dfqm10c6xeeb4hw6df", "MV Super-secret message transfer pasteboard type", "dyn.ah62d4rv4gu8zg7puqz3c465fqr3gn7bakf41k55rqf4g86vasbu1g7dfqm10c6xeeb4hw6df", "Super-secret Automator pasteboard type", "dyn.ah62d4rv4gu8yc6durvwwa3xmrvw1gkdusm1044pxqyuha2pxsvw0e55bsmwca7d3sbwu", "Apple files promise pasteboard type", "public.url", "CorePasteboardFlavorType 0x75726C20", "dyn.ah62d4rv4gu8yc6durvwwaznwmuuha2pxsvw0e55bsmwca7d3sbwu", "Apple URL pasteboard type", "public.url-name", "CorePasteboardFlavorType 0x75726C6E", "com.apple.pasteboard.promised-file-content-type", "com.apple.pasteboard.promised-file-url", "dyn.ah62d4rv4gu8y6y4usm1044pxqzb085xyqz1hk64uqm10c6xenv61a3k", NSPromiseContentsPboardType )</p> </blockquote> <p>Does anyone have any advice how to do this correctly in order to accept multiple e-mails? </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload