MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: sending programatically output to clipboard

  • To: mathgroup at smc.vnet.net
  • Subject: [mg88911] Re: sending programatically output to clipboard
  • From: Szabolcs Horvát <szhorvat at gmail.com>
  • Date: Wed, 21 May 2008 14:49:18 -0400 (EDT)
  • Organization: University of Bergen
  • References: <g0uai8$4ua$1@smc.vnet.net>

Adrian Lupascu wrote:
> Hi everyone,
> 
> I would like to find a way to programatically send some output to the 
> clipboard. For the time being I would like to do that with formatted 
> equations, and I would like to send them as bitmap or metafile (I work 
> on Windows). So it should be the equivalent of "Copy As". I searched on 
> the forum and I found a few posts on related topics, but I did not 
> manage to get it working.
> Any help is appreciated.
> 

Here's a way to do it:

gr = Plot[Sin[x], {x, 0, 10}]

nb = CreateDocument[gr, Visible -> False];
SelectionMove[nb, All, Notebook];
FrontEndTokenExecute[nb, "CopySpecial", "EMF"];
NotebookClose[nb];

This is based on a solution posted by John Fultz in March. 
Unfortunately I cannot find the original message on Google Groups.


  • Prev by Date: On which OS is Mathematica best implemented?
  • Next by Date: Re: sending programatically output to clipboard
  • Previous by thread: sending programatically output to clipboard
  • Next by thread: Re: sending programatically output to clipboard