5

Sometimes code or data in a posted question is in a box with a horizontal slider. Is there some way to select all of the data and copy it to put in a Mathematica notebook? I can only select what is displayed and then material outside the box, but never all the material within the box.

  • Dragging selection outside code block will force it to scroll. But I'm also interested in neat solution. – Kuba Aug 7 '13 at 14:00
  • You can also use this answer to import all of the code in a post using the URL from the "share" link – rm -rf Aug 7 '13 at 16:13
  • @ Kuba Dragging outside the code block in IE did not work for me. It ended up selecting material outside the code block. The triple click did work. – David Park Aug 7 '13 at 19:15
6

For all those who use browser user scripts: there is an Select Code Block Button Script which I have tweaked further to work for our site and Chrome. You can find my answer here

The script is really easy to use. As soon as you move the mouse over a code block, a Select button appears which when clicked selects all the text in the code block; with or without scroll bars.

enter image description here

  • @belisarius Hm, this is very unfortunate. I always thought the script was made for Firefox. Can you try the original script and change the header appropriately? You can just copy my header, so that it is working on on M.SE. – halirutan Aug 9 '13 at 17:03
  • Yep, the original one seems to work better with Firefox (v23.0). I haven't tested it extensively, but at least the edit window buttons are there – Dr. belisarius Aug 10 '13 at 1:17
1

In Firefox you can triple-click to select a full line, then while still holding the mouse button drag up or down to select additional lines.

Here is some junk code to test it on:

#/.(##&[15#->FizzBuzz,3#->Fizz,5#->Buzz]&)/@#&@Range@100 #//.(##&[15#->{3#,5#},3#->Fizz,5#->Buzz]&)/@#&@Range@100
foo[x_, y_, z_, opts1 : OptionsPattern[], z : {opts2 : OptionsPattern[]} : {}] :=  Grid[{{Plot[Sin[x a], {a, y, z}, opts1], Plot[Cos[x a], {a, y, z}, opts2]}}]
f4[s_, m_] := s[[#]] & /@ SparseArray[Permutations[1 ~Table~ {m} ~PadRight~ Length[s]]]["AdjacencyLists"]
  • OK, many thanks. That also works for Internet Explorer. – David Park Aug 7 '13 at 14:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .