I want to save an image that is on a card to either the desktop or a image folder as a jpeg file. Using drop and Drag would be cool.
I tried to drag the image to the desktop.
This doesn't work:
on dragStart
put ID of me into timage
set the dragData["image"] to image ID timage
end dragStart
Thanks for your help
Gregg
Drag to desktop
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Drag to desktop
Hi Gregg,
unfortunately this does not work the way one would exspect and as you tried.
To get a copy of your image somewehre on the desktop or elsewhere, you need to manage "the dragdata["files"]!
Question:
Is this an internal (imported) or referenced image?
Anyway, here we go.
If it is referenced then you could do this:
If it is an internal (imported) image you will have to export it to a file first.
In my example I export it to the temp folder, so the user does not see it, which is preferrable
Tested and works 
Best from germany
Klaus
unfortunately this does not work the way one would exspect and as you tried.
To get a copy of your image somewehre on the desktop or elsewhere, you need to manage "the dragdata["files"]!
Question:
Is this an internal (imported) or referenced image?
Anyway, here we go.
If it is referenced then you could do this:
Code: Select all
on dragStart
set the dragData["files"] to the filename of me
end dragStart
In my example I export it to the temp folder, so the user does not see it, which is preferrable

Code: Select all
on dragStart
put specialfolderpath("temporary") & "/Name of your target image here.jpg" into tTargetfile
export img "your image name here" to file tTargetfile as JPEG
## Rev is fast enough, the user will not see any delay!
set the dragData["files"] to tTargetfile
end dragStart

Best from germany
Klaus
Re: Drag to desktop
Thank so much. I did get that to work. I had to include .jpeg in the name of the image.
Then it worked like a charm!
Thanks again
Then it worked like a charm!
Thanks again