Dragging files onto macOS builds

Hi,

Do macOS builds support importing of files by dragging and dropping them onto the application window? 

The answer tothis question from 2015 suggests that it’s possible, but there seems to be no official documentation on how to implement this. There is a link to relevant documentation in that answer, but it just ends up at docs.coronalabs.com.

Any pointers?

Thanks,

Ninad.

Try this URL: https://docs.coronalabs.com/guide/distribution/macOSBuild/index.html#custom-document-types

Rob

Thanks, Rob!

Here is a basic example you can build and test:

https://github.com/roaminggamer/RG_FreeStuff/raw/master/AskEd/2017/08/macOSDragNDropAssets2DockIcon.zip

If anyone wants to see something more sophisticated (say something that actually uses the dropped assets) ping back with requests.

Thanks, Ed. I have it working for a bunch of file types and folders. From there on out, I plan to use lfs and the file/folder path to actually get the content and use it in the app. Did you have a better/alternative approach in mind?  

Also – this only recognizes drops onto the application icon in Finder/the Dock and not on the application window itself, right? Or am I still missing something?

Ninad.

  1. I would also use lfs to copy the files to doc or temporary folders for use in app.

  2. Right this only recognizes drops to the icon not the app.  

Try this URL: https://docs.coronalabs.com/guide/distribution/macOSBuild/index.html#custom-document-types

Rob

Thanks, Rob!

Here is a basic example you can build and test:

https://github.com/roaminggamer/RG_FreeStuff/raw/master/AskEd/2017/08/macOSDragNDropAssets2DockIcon.zip

If anyone wants to see something more sophisticated (say something that actually uses the dropped assets) ping back with requests.

Thanks, Ed. I have it working for a bunch of file types and folders. From there on out, I plan to use lfs and the file/folder path to actually get the content and use it in the app. Did you have a better/alternative approach in mind?  

Also – this only recognizes drops onto the application icon in Finder/the Dock and not on the application window itself, right? Or am I still missing something?

Ninad.

  1. I would also use lfs to copy the files to doc or temporary folders for use in app.

  2. Right this only recognizes drops to the icon not the app.