This one was written by Alberto Di Lullo, (who doesn't appear to be on Stack Overflow).
CopyToClipboard
, for Mathematica 7 (in Mathematica 8 it's built in)
CopyToClipboard[expr_] :=
Module[{nb},
nb = CreateDocument[Null, Visible -> False, WindowSelected -> True];
NotebookWrite[nb, Cell[OutputFormData@expr], All];
FrontEndExecute[FrontEndToken[nb, "Copy"]];
NotebookClose@nb];
Original post: http://forums.wolfram.com/mathgroup/archive/2010/Jun/msg00148.html
I have found this routine useful for copying large real numbers to the clipboard in ordinary decimal form. E.g. CopyToClipboard["123456789.12345"]
Cell[OutputFormData@expr]
neatly removes the quotes.