Skip to main content
Participant
November 8, 2017
Question

Drag & Drop question

  • November 8, 2017
  • 2 replies
  • 614 views

Hi

I want to drag some assets from my extension panel into the project panel for importing. Is there a way to intercept the drop event? These assets needs to be downloaded before importing.

Thanks

Anand

This topic has been closed for replies.

2 replies

ZetiSam
Participant
February 1, 2018

Assuming we're talking about premiere:

I was facing the same issue. I couldn't find a way to have premiere load the assets for me from the HTTP-url. So the downloading of the asset must happen by the extension. I came up with two solutions:

* Require the user to download the assets first, so they are stored locally (but not yet added to the project). Once the files are local, they can be added to the projects folder (or directly to the timeline) using regular drag-and-drop using a little trick:

You add a javascript eventlistener for the dragstart-event on the element that you want to drag and drop to the project panel, and add the local file path to the payload:

event.dataTransfer.setData('com.adobe.cep.dnd.file.0', localFilePath);

* You could use the above approach, but instead of having the user download the asset beforehand, you refer to the localFilePath of a (random) image that is local. Then, when the user has dropped the asset, you'll start downloading the video and when this is completed you can replace the image by the video.

Loic.Aigon
Legend
November 9, 2017

Hi Anand,

You didn't specify the host application but i will presume you are talking of either Premiere or AE. There is point dealing with dnd in the sdk:

https://www.indesignjs.de/extendscriptAPI/indesign10/#Hyperlinks.html#d1e106534__d1e106541

Never worked with vid apps but at this point, I guess you mostly need to know how data has to be brought to the native UI. For exemple, DnD in InDesign implies that you loads data into the "cursor". So ypu may have to find what is AE/Pr specific in your case.

HTH

Loic