Page 1 of 1

drag and drop emails

Posted: Thu Dec 31, 2020 3:56 pm
by stan
Hi All,

I've been struggling with drag and drop for a few days and have hit a brick wall. In short - I'm building a task manager type app that allows the user to gather all the relevant information about a task in one place. So far I can drag & drop files, text and URLs to my app and everything works (the app stores the dragged data so it ve be viewed/opened). However, if i try to drag an email from Apple Mail or Outlook clients I simply can't figure out how to handle this. If you drag & drop a selected message from either Apple Mail or Outlook to a finder window then a file with type ".eml" is created and double-clicking that file opens Apple Mail (or default mail app) and shows the message - so clearly something tangible is being dragged & dropped. Ideally I'd like my app to store this .eml file somewhere and allow the user to open the relevant message by opening it from in my app just as it current does with word, excel and other file types.

I've tried looking at the keys (and contents of the keys) or dragdata[], rawdragdata[], fulldragdata[] and even the raw clipboard and, whilst some of these arrays contain information, none of it appears to be usable to store either the message or a link to the message in my app.

Any ideas would be very welcome!

Re: drag and drop emails

Posted: Mon Jan 04, 2021 9:48 am
by richmond62
Well: first, a confession: after about 20 years of mucking around with LiveCode this is the
first time I have ever played with drag-ad-drop where I am dragging something from outwith a stack.

macOS 11.2 Beta / LC 9.6.1

1. I set up a stack with a textField in the middle of it.

2. I opened the Thunderbird email client I use, and dragged the selected text from a message across into the field. That worked.

BUT: ALL I got was the text with no way to link back to the original email.

3. Dragging the email header resulted in nothing at all.

4. Dragging the selected text to the Finder gave me a text clipping.

5. Dragging the slected text into a browser widget was a waste of time.