macOS Sierra - Promised file drop on App icon

Hi there,

I have an app where users can drop files on the application icon in the dock.
I’m accepting any kind of file, “promised” files (from Photo, eg) or files from the finder.

Desktop app OSX, Xojo 2016r3

This is working fine with El Capitan (10.11.6).

This is NOT working with macOS Sierra (10.12.1) when dropping “promised” files on the app icon.
It’s fine with finder files.
It’s fine when dropping promised files on the application window.

So the problem is limited to dropping on the application icon, the OpenDocument event is not fired for promised files.

I don’t think it’s a Xojo problem as I’m having the same problem if I drag a Photo file to the dock Mail icon (which works with El Capitan).

Does anyone know if something has changed with Sierra and if there’s a workaround ?

Thanks and best regards.


And dragging the file into the Application’s Icon in the Dock ?

That’s what I’m saying :wink:
I’m dragging a file from Photo (eg) and drop/release it on the Application’s icon in the Dock.

It works with El Capitan, not with Sierra.

The short answer; you’re not meant to work with Photos in this way. I’ve filed a bunch of bug reports over Photos and application interconnection and they’ve all been closed “Due to design”.

So what you’re meant to do is to create your application in Swift and Xcode, you put all your photo manipulation effects into a central ‘Framework’ then you create Photos plugin with one interface, that calls upon the Framework and a desktop application with another interface (but the same framework).

What a lot of companies have ended up doing it creating a Photos plugin that write the CGImage to disk, then opens their application and passes it the image, then when you save in their application, it replaces the image created by the plugin, which then reloads the CGImage and returns it back to Photos.

My biggest gripe is the one application that customers want a Photos plugin, works best with RAW images - read multiple in one go. Which a Photos plugin doesn’t support at all. You get an 8-Bit image from a RAW file, and only one image.

If you have customers bemoaning this change, file a bug report with Apple and advise your customers to downgrade if they can, or tell them to look at Adobe Lightroom, while looking like something from the 1990s is a much more developer and powerful application that Photos can ever dream of being.

Hi Sam,

Thanks a lot for your answer.
My application is not worth writing a Xcode or Swift plugin and, even if it was, I don’t have a sufficient knowledge to do it.

The app is not published yet, so the easiest is to remove the ability to drop on the application icon. So the future customers won’t complain about regression when they upgrade from El Capitan to Sierra.

What is surprising is that I can drag/drop from Photos on the application windows, just not on the icon.
What is also strange is that this doesn’t work anymore with Mail which is an Apple application.

I’ll search and monitor stack overflow to see if other developers have the same issue with Xcode/Swift apps.

Thanks anyway.

Xojo use that too ! :-{

bta 10.12.2 (16C53a):

The application generated using Xojo 2015r1 on El Capitan.

Drag and drop a text file to the application Icon: file loaded.

Drag and drop a text file to the Dock application Icon: file loaded.

Drag and drop a text file to the application window: loaded.

32 bits (of course in this case)

I suppose you:
This Computer --> File Types (click in the button and check some or all file types CheckBoxes.

My Radar issue about dragging and dropping multiple files to the desktop not working has the issue no 26.530.592. This is a duplicate to 4.520.993. Which makes the original bug old old old.

@Emile Schwarz [quote]Drag and drop a text file to the application Icon: file loaded.[/quote]

To clarify, I have NO problem dragging & dropping files from the Finder or from the Desktop to the application window for to the dock application icon.
The only problem is dragging files from Photos to the dock application icon, i.e. with promised files.

Again, I don’t think it’s Xojo related as I have the same problem dragging files from Photos to Mail, e.g. which is working fine with El Capitan.

Another solution that I don’t want to toss into the ring:
Make your app Sierra only.

I wish I could strangle someone at Apple for making Photos use promised file drops. Although I do understand why they do it.

I have a book at home from Apple about how to make your applications support interapplication communication and why making apps so they can work together is better for the user. Now we have each app as an island mentality.

Promised files don’t exist until the drop is completed; then it’s the responsibility of the promiser to create those files at that location. At first I thought that Apple Photos was simply copying the files there, but then found that no, it’s actually opening the original file and then saving a lower quality JPEG in the dropped location.

Yes Sam, I noticed that too, the dropped image is not the same quality as the original one. Even “exporting” a file doesn’t always give the best quality.

I wanted to point out that dropping on the docked application icon is working with El Capitan and not with Sierra.
So if Apple didn’t change this behavior ‘by design’ it’s a regression.

There is another way… You can use the NSMediaLibraryBrowser to display a floating window to which people can use to pick their photos from “Photos” and any files dragged in from this palette are REAL files, not promised files.

When discussing this thread; I forgot all about this function. I’ve used it in the past with good success.

Thanks Sam,

Thanks for the tip and for sharing the sample app, its much better indeed.
I’ll have to find a way to customize the Media controller appearance to match my own app style but I’m not sure it’s possible…

[quote=301309:@Olivier Colard]Thanks Sam,

Thanks for the tip and for sharing the sample app, its much better indeed.
I’ll have to find a way to customize the Media controller appearance to match my own app style but I’m not sure it’s possible…[/quote]
You’re welcome and I’m not sure it’s easily doable, I seem to recall reading that there is a way of embedding the control into a window, but I never explored it as this ‘sorta’ worked.

It is a lesser evil of sorts; and I don’t know how long it might be around for, but in the mean time it’s certainly better than that promised file shit.