Just skimming through the docs, it looks like you need to register a clipboard handler which will then receive messages when clipboard actions occur. Did you SetClipboardOptions?
It doesn't really look like that is what you need for drag-and-drop operations though.
I did register my custom format handler. (I did set the clipboard data struct and the clipboard options as well).
I would like to add to Illustrator a new clipboard format handler, so I could do that:
From my HTML extension, I could set the clipboard (data) with my custom data and custom format, on start dragging item.
Then, in my plugin, on drop item action, I want my custom format handler to do the magic! Read the clipboard data and then create arts or whatever.
I don't if you could do that without using the clipboard!
Did you register message handlers for the clipboard messages?
I did override the message method in my plugin class to check the caller (kCallerAIClipboard) and the selector (kSelectorAIGoClipboard) but method was never called.
I have found an alternative solution for what I wanted to do!
But I still want to know how does the clipboard work!
Still looking for answers!
DragStart Event : Set data to be dragged inside event data.
DragEnd Event : Give ajax call and download the item (if its is image). Save it locally inside extension folder. Call jsx function to do app specific handling.Let extendscript do its magic. Thats it.
I don't have idea if it is possible through clipboard. Above approach is straight enough. Help me know if clipboard approach is even easier.
Thanks for the tips!
Anyway, I finally found an alternative solution to handle drag and drop operations from extensions to Illustrator.
I actually did not use the clipboard.
I just set the data transfer object on drag start. (extension).
On the plugin side, I had to be notified when the scene graph was modified.
Finally with a smart move, I was able to retrieve the object dropped (text/plain with custom informations, uri, metedatas, ....) and do whatever I wanted.
(create group, add image, text,......)
That's pretty simple and works fine!