Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2013

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

Search the Archive

Attaching a notebook to a message

  • To: mathgroup at smc.vnet.net
  • Subject: [mg129339] Attaching a notebook to a message
  • From: David Bailey <dave at removedbailey.co.uk>
  • Date: Sat, 5 Jan 2013 02:20:45 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net

I suddenly realised that there is (probably) a way to attach a notebook 
to a message here! The trick is to compress the expression which is the 
notebook:

Compress[NotebookGet[nb]]

For example:

"1:eJzVUslOwzAQdSlQtgouHLggIwS0YhGtqooTEruQgEoNggPikBQHLBw7xI5aOHHmyF8\
hxI/wFXicUNKUpYgTl5c3M2/\
Gs2TGEXV3ACEkhzQcCUUcIa7dDHj6NRxQqT6sLcKY2wdWPrb2AhH627ayI3c7JZtMsSY1s\
TybMSxtz2cE8/ghaxQioSNDR1HFyEeVesiIHI8LbF3Z/JIcU49IAgpoCL4I4YXy4+\
sGQlMF+P6506hATsOmaBmxcQxCQ6KpfW5/MtkCckQ0AdlZl3ige42JaN+\
30e6HrJvgq4eyHWKIzhpcNFg2eG5w3uCSwVaCV2INtLzP/VD99hT3T9PmFPcPc+\
YUvew1F08FI/w8UjTG4r9LjXcN0lqoelttJl4tQi9mnUZd8wlvk1SREU1OKb8QTYveEf5+\
lmcNDd1ZSp1vqw/t4JJymfoZOyw5rMlGqIRnK9qgY5lkORDQdbA6VJ+\
MuBsIrnb4xQkJJBXcqmjf2soqdkWAD2kjEFK4CkddSVyoVpYdqoq4UGso4ZAAV5dwebVUK\
qZKT8BJ1C0j28SlnCpdWlqwDW3bIVMr3HkDs7QGzA=="

Since Compress only uses printable ASCII characters, hopefully if you 
paste the above string into a notebook and perform:

string//Uncompress//NotebookPut

Of course, it is also possible to paste the raw output from NotebookGet, 
but that will be considerably more voluminous. Also a compressed string 
that becomes corrupted will be utterly destroyed, so it is probably 
safer than using the raw BoxForm expression.

NB: The 9.0 bug that messes up cell merges, also affects NotebookGet, so 
I would suggest you use 8.0.4 for this trick until 9.1 comes out.

This is really a test to discover if this survives the posting process!

David Bailey
http://www.dbaileyconsultancy.co.uk


  • Prev by Date: Re: Here is the problem with DiscreteMarkovProcess...
  • Next by Date: Re: How to get the Real and Imaginary part of an expression
  • Previous by thread: Re: Here is the problem with DiscreteMarkovProcess...
  • Next by thread: Re: Attaching a notebook to a message