I learned that copy something to kill buffer, I can use the kill-new buffer
(kill-new (file-truename buffer-file-name))
How about copying the content to clipboard? Does emacs/elisp provide the function?
ADDED
I got 2 answers, but the answer seems to apply X windows system. As I use Aquamacs, it may not be a universal solution that can be applied to my problem.
Documentation for x-set-selection says: