11.07.2015 Views

webMathematica™ Wolfram - Wolfram Research

webMathematica™ Wolfram - Wolfram Research

webMathematica™ Wolfram - Wolfram Research

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

52 webMathematica User GuideNeeds["ExampleUtilities`Content`"]If[MSPValueQ[$$button],MSPReturn @@ GeneralContent[$$button]]This example takes a format type and converts a notebook intothis format type. It returns the converted notebook.Here is the Mathematica source.MakeNotebook[fmt_] :=Developer`UseFrontEnd[Module[{nb, nbobj},nb = NotebookCreate[];NotebookWrite[nb, Cell["A Dynamically Created Notebook","Title"]];NotebookWrite[nb, Cell["Converted to " fmt, "Subtitle"]];NotebookWrite[nb, Cell["The date is " ToString[Date[]],"Text"]];SetOptions[nb, WindowSize -> {400,500}];nbobj = NotebookGet[nb];NotebookClose[nb];nbobj]]GeneralContent[fmt_] :=Module[{nbobj},nbobj = MakeNotebook[fmt];Developer`UseFrontEnd[AbortProtect[Switch[fmt,"Notebook",{ToString[nbobj, InputForm], "application/mathematica",

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!