Placing an image on the clipboard - OSX
Posted: Sun Dec 08, 2013 12:04 pm
I am attempting to use the following code to place a jpeg image onto the clipboard so that it may be pasted into an Apple Pages document, my live code application has a list of thumbnails and the user selects an image thumbnail so that the full size image may be used in a 3rd party application such as Apple Pages.
I planned on using the clipboard as the means of transferring to image data from my livecode application to Pages but I have encountered problems when attempting to do the paste. The file path is correct and the correct image is being processed but when I try to paste it into pages this error is posted: "The media can't be used because you don'y have access privileges, or because it has no content or is corrupt".
Well I do have access and I am able to post the image back into livecode so it seems that Pages does not like the format. Any ideas?
I planned on using the clipboard as the means of transferring to image data from my livecode application to Pages but I have encountered problems when attempting to do the paste. The file path is correct and the correct image is being processed but when I try to paste it into pages this error is posted: "The media can't be used because you don'y have access privileges, or because it has no content or is corrupt".
Well I do have access and I am able to post the image back into livecode so it seems that Pages does not like the format. Any ideas?
Code: Select all
on mouseUp
put fld"folder" & "/" & "testimage.jpg" into tTarget
import paint from file tTarget //imports the image into the stack/card
set the clipboarddata["image"] to the last image
--copy the last image
delete the last image
end mouseUp