<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi tim<div class=""><br class=""><blockquote type="cite" class="">On 17.07.2019, at 22:27, tim Rowledge <<a href="mailto:tim@rowledge.org" class="">tim@rowledge.org</a>> wrote:<br class=""><br class="">We've had handlers for dropping files onto Squeak for ages but it doesn't appear to do anything if I drag an item from an outside application - for example, dragging an email from the mail app on my iMac. So far as I can tell it doesn't even get an event into the image.<br class=""><br class=""></blockquote><div class=""><br class=""></div><div class="">What works is dropping files. Just tested with a TXT file.</div><div class=""><br class=""></div><div class="">Please doIt: [FileStream primDropRequestFileName: 0]  and then see if [SmalltalkImage current listLoadedModules] contains the DropPlugin.</div><div class=""><br class=""></div><div class="">It should, because it usually is compiled-in, at least on mac.</div><div class=""><br class=""></div><div class="">I dropped some other files and you should at least get a question what to do with it…</div><div class=""><br class=""></div><div class=""><br class=""></div><blockquote type="cite" class="">Has anyone done anything with this ? I'm hoping to make it possible to drag an email with license/key info and avoid a user having to manually paste stuff. Seems like it might be a nice way to simplify life.<br class=""></blockquote><div class=""><br class=""></div>NOTE the next is OSX (or macOS) specific. The world is completely different with holes in Walls and penguins (let alone, demons and pufferfishes)<br class=""><div class=""><br class=""></div><div class="">Dragging an email directly has not worked for me.</div></div><div class="">Reading the code in platforms/iOS/vm/OSX/sqSqueakOS*View.m, specifically -filterOutSqueakImageFilesFromDraggedFiles: (which is the same in all implementations *hint hint*)</div><div class="">it seems we filter out anything in dragged stuff that is _NOT_ filenames:</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">   </span>if ([[pboard types] containsObject: NSFilenamesPboardType]) {<br class=""><span class="Apple-tab-span" style="white-space:pre">          </span>NSArray *files= [pboard propertyListForType: NSFilenamesPboardType];<br class=""><span class="Apple-tab-span" style="white-space:pre">           </span>NSString *fileName;<br class=""><span class="Apple-tab-span" style="white-space:pre">            </span>for (fileName in files) {/*...*/</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">While this (NSFilenamesPboardType) is already deprecated since *rustling* exactly 10 years![1] and we should use </div><div class="">a completely different API [2], we still have to deal with the fact, that files look different when dragging:</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><img apple-inline="yes" id="97EEF926-562B-4983-BF47-B2E7AECCE2C7" src="cid:7F317714-29E8-4A55-B150-9203ADC45AC9@fritz.box" class=""></div><div class=""><br class=""></div><div class="">than an email:</div><div class=""><br class=""></div><div class=""><img apple-inline="yes" id="D0F92AAF-00A2-4A17-9CF0-4595C8BA311A" src="cid:C2B9A07E-64AC-4707-A8E1-D726B1037C1D@fritz.box" class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">(especially the promised-content part!)</div><div class=""><br class=""></div><div class="">And we somehow have to make up our mind how to turn that into squeak events (which currently only deals in file names and file handles…)</div><div class=""><br class=""></div><div class="">Further reading:</div><div class=""><span class="Apple-tab-span" style="white-space:pre">      </span>- <a href="https://stackoverflow.com/questions/14397905/drag-and-drop-mail-into-os-x-app" class="">https://stackoverflow.com/questions/14397905/drag-and-drop-mail-into-os-x-app</a></div><div class=""><span class="Apple-tab-span" style="white-space:pre">      </span>- <a href="https://stackoverflow.com/questions/17859184/drop-e-mail-from-mail-app-into-nswindow-object" class="">https://stackoverflow.com/questions/17859184/drop-e-mail-from-mail-app-into-nswindow-object</a></div><div class=""><br class=""></div><div class="">Hope that helps.</div><div class=""><br class=""></div><div class="">Best regards</div><div class=""><span class="Apple-tab-span" style="white-space:pre">       </span>-Tobias</div><div class=""><br class=""></div><div class="">[1]: <a href="https://developer.apple.com/documentation/appkit/nspasteboardtype?language=objc" class="">https://developer.apple.com/documentation/appkit/nspasteboardtype?language=objc</a></div><div class="">[2]: <a href="https://developer.apple.com/documentation/appkit/nspasteboard/1524454-readobjectsforclasses?language=objc" class="">https://developer.apple.com/documentation/appkit/nspasteboard/1524454-readobjectsforclasses?language=objc</a></div></body></html>