Missing dragData["image"]

Alejandro Tejada capellan2000 at gmail.com
Tue Sep 16 16:49:11 EDT 2014


Hi All,

Chilton Webb posted a question on Facebook:

"Hi, I'm trying to drag an image off a webpage into a livecode object.
Currently, I'm using dragdata["image"], and it returns empty. 
Other options return the url the image points to, but 
none of them return a url to the image itself.

In a Cocoa app, I can confirm that there is image data there, 
in the drop event, the form of NSTIFFPboardType.

How do I get at that data, from inside LiveCode?
Is it likely to also fail in the same way, on Windows?"

After some tests, the problem appear to be that Livecode does not
recognize the dragData of an image.
When did LiveCode's dragData recognize the dropped data as image?

To test this, paste this script in a field and 
1) drag an image from a webpage... 
2) drag an image from a folder...

on dragDrop
put the keys of the dragdata -- look at the message box
if the dragData["text"] is not empty
then
put the dragdata["text"] into tVar
if char -4 to -1 of tVar is among the items of ".jpg,.png,.gif"
then
create img
set the filename of it to tVar
end if
end if
pass dragDrop
end dragDrop  

a) Dragging an image from a webpage, 
Livecode dragData results are: Unicode, Text

b) Dragging a JPG image from the Pictures folder 
results are: Files, Text

When did LiveCode dragData recognize the dropped data as image?

Al



--
View this message in context: http://runtime-revolution.278305.n4.nabble.com/Missing-dragData-image-tp4683313.html
Sent from the Revolution - User mailing list archive at Nabble.com.




More information about the use-livecode mailing list