Working with image media fields

Hi all,

I’m betting that there are simple answers here, but I have not found them quite yet! Here goes:

  • Is there a way to take the contents of an image media field and put it on the clipboard? For example take a company logo from a media field and get it on the clipboard so it can be pasted into a Word or PowerPoint document?

  • Is there a way to get the size of the contents of an image media field… as you can when doing a get info on a Mac for a png, gif or jpg file (i.e. 50x50 pixels)

  • Finally, is there a way to export the contects of an image media field. If the user put a gif, png or jpg in, can we export it to a gif, png or jpg file?

Thanks,

Rich Coulombre

Hi Rich,

Short answer - YEP to all. :D

  1. application.setClipboardContents - just put the media (binary) data on there. Open word. Paste.

  2. In 2.2.3 use the “image” plug-in and it will give you the height and width of the object (if gif, png or jpg).

  3. To export - just write the file to disk with the correct extension (C:\myfile.gif).

Hope this helps.

"application.setClipboardContents - just put the media (binary) data on there. Open word. Paste. "

According to the docs this works only with text strings. I did try with image media for fun but no luck. Am I doing something wrong, or is this just for strings?

Thanks,

Rich Coulombre