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.

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

3 Comments

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 (developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/…) are disabled for custom views of the dock Tile
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?
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'.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.