MathGroup Archive 2002

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

Search the Archive

RE: Re: Re: Using Mathgroup Effectively -- cutting and pasting expressions

  • To: mathgroup at
  • Subject: [mg35325] RE: [mg34943] Re: [mg34910] Re: Using Mathgroup Effectively -- cutting and pasting expressions
  • From: "DrBob" <majort at>
  • Date: Mon, 8 Jul 2002 03:17:54 -0400 (EDT)
  • Reply-to: <drbob at>
  • Sender: owner-wri-mathgroup at

I had been using the palette described below under 4.1.  I tried to
recreate it under 4.2 and found that I can't!  After evaluating the
code, the "Copy As InputForm" button appears on the screen, but I can't
save it.  I remember that being easy to do under 4.1.

If I close the palette, Mathematica doesn't ask if I want to save it.
If I select "Save As..." Mathematica assumes I'm trying to save
something else.  If I close everything but the palette, there's no
"Save" or "Save As" options under File.

Am I missing something, or is this really bizarre?

Bobby Treat

-----Original Message-----
From: Omega Consulting [mailto:omega_consulting at] 
To: mathgroup at
Subject: [mg35325] [mg34943] Re: [mg34910] Re: Using Mathgroup Effectively --
cutting and pasting expressions

At 01:15 AM 6/12/2002, Dave Collins wrote:

>Of course, if this were a carefully formatted notebook, I'd need to
>the changes after conversion and copying. Given all the other options
>under the "Edit|Copy as" menu, it would be nice if Wolfram would add
>"Copy as input form", perhaps with the option of making it the default.
>-- Dave Collins

Here's code for a palette that does just that. It takes a selection and 
passes it through Cell>Convert To>InputForm and then does Edit>Copy 
As>Plain Text (all without altering the original selection).

   Notebook[{Cell[BoxData@ButtonBox["Copy As InputForm", ButtonFunction
               Module[{cpy, cpynb, evalnb},
                 cpy = NotebookRead@InputNotebook[];
                 If[cpy === {}, Return[]];
                 cpynb = NotebookCreate[Visible -> False];
                 NotebookWrite[cpynb, cpy];
                 SelectionMove[cpynb, All, Notebook];
                 evalnb =
                       Map[Cell[#, "Input"] &, {
                           BoxData@RowBox@{"cpynb", "=", ToBoxes@cpynb},
                       Visible -> False];
                 SelectionMove[evalnb, All, Notebook];
             ButtonEvaluator -> Automatic,
             Active -> True], "Text"]},
     WindowClickSelect -> False,
     ShowCellBracket -> False,
     WindowSize -> {150, Fit},
     WindowElements -> {},
     WindowFrame -> "Palette",
     WindowFrameElements -> {"CloseBox"},
     ClosingAutoSave -> True

Omega Consulting
"The final answer to your Mathematica needs"

Spend less time searching and more time finding.

  • Prev by Date: RE: RE: How to suppress the mesh in ParametricPlot3D ?
  • Next by Date: Re: 196 algorithm, Most Delayed Palindromic Number
  • Previous by thread: Re: Strategy for overly long computations?
  • Next by thread: Re: 196 algorithm, Most Delayed Palindromic Number