Trying to copy a local animated .gif
file into NSPasteboard
. The operation appears to complete successfully however, only the first frame of the .gif
is present when pasted.
let filePath = "file:///Users/me/Documents/test.gif"
let pasteboard = NSPasteboard.generalPasteboard()
pasteboard.clearContents()
pasteboard.declareTypes([NSFilenamesPboardType], owner: nil)
pasteboard.writeObjects([fileUrl])
What I have so far is based mainly off of this post, but I'm guessing the author's .gif
wasn't animated and thats why it worked for them?