Using objc_util, which I really don't understand well at all, and working off examples I've found here and there on this forum, I feel like I almost have it.... just trying to put an animated GIF onto the clipboard so it can be pasted into another app.
Method 1 below (commented out) works, but when the image is pasted it is unfortunately a .PNG.
Method 2 allows you to specify image type. However, this does not seem to work at all. Clipboard is empty.
# coding: utf-8
from objc_util import *
UIPasteboard=ObjCClass('UIPasteboard')
pb=UIPasteboard.generalPasteboard()
#method 1: works but creates a .png:
#imgdata = UIImage.imageWithContentsOfFile_('test.gif')
#pb.setImage_(imgdata)
# method 2: does not work. pasteboard is empty
imgdata = NSData.dataWithContentsOfFile_('test.gif')
pb.setData_forPasteboardType_(imgdata, ns('kUTTypeGIF'))