In a similar vein, I have a shell script (fish, in my case) that combines these to let me quickly modify the contents of the clipboard:
function pbedit
set tmpfile (mktemp /tmp/pbedit.XXXXX)
pbpaste > $tmpfile
if vim -c "set nofixeol" $tmpfile
pbcopy < $tmpfile
end
rm $tmpfile
end