Skip to main content
SuperMacGuy
Known Participant
September 17, 2012
Question

Drag and Drop, OS X

  • September 17, 2012
  • 1 reply
  • 1145 views

I'm trying to build a Mac desktop app that includes functionality to drag and drop images onto an InDesign page, just like the Finder can do. I've been trying to work with the pasteboard types to pass either an NSString or NSURL to the pasteboard and then to InDesign to place the image. But so far, I have had no success. I can make a string of text get placed on the page, but not an image.

Is there something I am missing? Is there some strange ID quirk that relies on some not-well-documented Finder pasteboard function?

I'm passing something like this:

@"file://localhost/Users/chris.paveglio/Desktop/test/Screen%20shot%202012-03-22%20at%2010.25.29%20AM.png"

I tried this old bit of Apple sample code called "Pasteboard Peeker" and that showed me nearly the exact same pasteboard items getting dragged from the Finder as get passed from my app.

Chris

This topic has been closed for replies.

1 reply

Legend
September 17, 2012

As InDesign is still carbonated ;-) it internally deals with four-character-codes for flavors. A FSSpec with 'fssP' flavor is the most likely candidate for your effect, but I don't know if any non-deprecated Apple API still supports creation of those.

I'm not certain though, because my own experience is limited to plugins that force the receiving side - the internal drag&drop system of InDesign - to accept straight web browser drags.

Another thing to watch out is order of the flavors, it definitely makes a difference.

Dirk

Inspiring
September 9, 2014

Hi Dirk,

You have said InDesign was based on Carbon. Is it also true for InDesign CC 2014? Or have InDesign migrated to Cocoa? Could this explain the difference in Drag and Drop behavior between different versions of InDesign?

Legend
September 9, 2014

Yes, the move towards Cocoa was one big change for InDesign CC.