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.
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
Related
I'm looking for a way to customize the drag/drop of windows/tabs. I have a document based app, with a custom window controller. I am able to create tabs for it and have them all along the top, they all show, everything works great with that.
Where I'm running into trouble is if I create a different unconnected windows and start trying to drag windows or tabs into different windows or tab bars to have it dock or merge. Sometimes it works how I want, sometimes it doesn't allow docking or anything. Other times it does what I don't want it to do. I need a way to help it along...
I'm looking for a way to tie into those events but in all my searching I can't find what api or where it is that is controlling the window drags/drops. I looked into the NSDraggingDestination but that has nothing relating to windows, just pasteboard stuff. Looked at NSWindowController and didn't see anything there either. Anyone know if this is possible?
I have icon overlays working in Finder using mac_inject through the drawImage: method of the class IKImageBrowserCell (I also have the various list views working).
When Finder is switched into Arrange By Kind (or anything other than Arrange By Name) then the icon overlays no longer work.
Has anybody figured out what class needs to be used for these other views? I've been experimenting for days with no luck.
If your question is still actual, there are perfect tool called liferay-nativity hosted in github. It's cross platform, open source tool for adding icon overlay. It works with Finder very well.
https://github.com/liferay/liferay-nativity
I have just started coding an application in cocoa on OSX 10.6.8. It is well underway mostly thanks to threads I have found here. For the subtle functionality I am about to explain I've looked everywhere and really have given it my best without success. Here is the situation:
There is a browser (chrome for now but the solution should be adaptable to FF and Safari at least)
There is my chrome extension
There is my desktop app
Text/images can be dragged on my desktop app which then organises these items by source.
For a file/text from finder, except a web browser, tagging the file with its file path is the desired behaviour, for a text I simply put clipboard as the source. Now the issue is that files/text dragged from a web browser should have the website they were dragged from as the source. There is an easy fix for files: I have an extension which sets a buffer with the last active url so that all I need to check when a file is dragged is whether it comes from the chrome cache to tag it with the content of the said buffer. My problem is for text. The way text dragging is handled is by using a service which I declared in the .plist, There is a similar unanswered question on SO and a technique that seems as if it could work but it is only available for 10.7 on. I also found a link where someone managed to get the url for itunes songs dragged on his application using http://www.mail-archive.com/cocoa-dev#lists.apple.com/msg17452.html
Is there a solution to see the URL of a dragged image/text that could be handled using only cocoa?
The only other option I see is using the extension to inject javascript code into all webpages for handling the 'dragenter' event and send the content of what is being dragged together with the source URL to the desktop app via a custom protocol. I'm not too keen on script injection and I sense some complication down that path as well.
In any case thank you for your help!
Chocozor.
I want to create an NSView which will accept dragged items from the KeychainAccess app (for example a certificate).
Dragging a certificate to the desktop results in a file, so I think it should be possible to receive them in my NSView as well. I know the basic concept of drag and drop in Cocoa and searched / tried a lot already, but I really don't know how to achieve this.
Any help would be appreciated!
Jodocus
I have a project that I am attempting to do and we want something similar to what the Apple store does. We thought it was a Quartz Composer interactive desktop but I've been putting together an xcode cocoa solution to do it too.
Here is an image of what I'm wondering about it is just a Title and 3 images that link out to url locations. If anyone can point me in the direction they believe can make something like this I would appreciate it.
I have used Quartz Desktop to display a .qtz but it isn't interactive. If anyone knows of another quartz desktop displaying .app that does use the interactive parts such as mouse and keyboard, it would be appreciated.
Applestore demo http://img707.imageshack.us/img707/614/dsc03934y.jpg
It's a custom proprietary program called, if I remember correctly, Concierge. But it's not doing anything tricky. You can make any NSWindow appear on the desktop by setting its window level to kCGDesktopWindowLevel.