0

After many hours searching for a solution to this I'm still stuck, I would be very grateful for your help.

Here is my situation: I would like to know the source application for the (drag and ) drop of a document/file on my app's dock icon (it accepts anything as specified in the .plist). In fact the final goal is to know the url of the dropped document/file if it's a browser drop. For now, knowing the application name should be enough. I simply cannot manage to get the source for a drop, it cannot reliably be found/deduced from the Drag Clipboard as it seems that some applications do not use this (such as Chrome).

Does anyone have a clue about this?

Thank you,

chocozor.

chocozor
  • 21
  • 2

1 Answers1

0

If you're dropping file icons on your app icon in the doc, have you tried the

application:openfile:

or

application:openfiles:

methods in your app delegate?
NSApplicationDelegate documentation: https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/NSApplicationDelegate_Protocol/Reference/Reference.html

mcallister
  • 165
  • 10
  • Yes absolutely, the problem is that there is no reference to the object sending the message as in - (NSDragOperation)draggingEntered:(id < NSDraggingInfo >)sender ; I tried to place a custom view on my dock icon that accepted dragging operations but it seems to be the case that dragging operations as defined in the drag & drop guide of apple (https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/DragandDrop/DragandDrop.html#//apple_ref/doc/uid/10000069i) are disabled for custom views of the dock Tile – chocozor May 06 '13 at 23:53
  • Are you trying to use the custom view solely for dropping files on the dock tile and getting their paths? And have you tried drag and drop on the application tile when it is on the desktop? – mcallister May 07 '13 at 02:08
  • I was actually trying to use the custom view to have access to the reference to the object sending the message (dragging source). This way you could call the [sender draggingPasteboard] method and have access to the pasteboard containing information such as the source url via the 'Apple URL pasteboard type'. – chocozor May 07 '13 at 10:13