13.07.2015 Views

Mathematica Tutorial: Notebooks And Documents - Wolfram Research

Mathematica Tutorial: Notebooks And Documents - Wolfram Research

Mathematica Tutorial: Notebooks And Documents - Wolfram Research

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Simple and Compound Front End Tokens<strong>Notebooks</strong> and <strong>Documents</strong> 167By using NotebookWrite you can effectively input to the front end any ordinary text that youcan enter on the keyboard. FrontEndTokenExecute allows you to send from the kernel anycommand that the front end can execute. These commands include both menu items and controlsequences.FrontEndTokenExecute@"name"Dexecute a named command in the front endExecuting a named command in the front end."Indent""NotebookStatisticsDialog""OpenCloseGroup""CellSplit""DuplicatePreviousInput""FindDialog""ColorSelectorDialog""GraphicsAlign""CompleteSelection"indent all selected lines by one tabdisplay statistics about the current notebooktoggle a cell group between open and closedsplit a cell in two at the current insertion pointcreate a new cell which is a duplicate of the nearest inputcell abovebring up the Find dialogbring up the Color Selector dialogalign selected graphicscomplete the command name that is the current selectionA few named commands that can be given to the front end. These commands usually correspond to menuitems.Front End TokensFront end tokens let you perform kernel commands that would normally be done using themenus. Front end tokens are particularly convenient for writing programs to manipulatenotebooks.FrontEndToken is a kernel command that identifies its argument as a front end token.FrontEndExecute is a kernel command that sends its argument to the front end for execution.For example, the following command creates a new notebook.In[10]:=FrontEndExecute@FrontEndToken@"New"DDFrontEndExecute can take a list as its argument, allowing you to execute multiple tokens in asingle evaluation. When you evaluate the following command, the front end creates a newnotebook and then pastes the contents of the clipboard into that notebook.In[9]:=FrontEndExecute@8FrontEndToken@"New"D, FrontEndToken@"Paste"D

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

Saved successfully!

Ooh no, something went wrong!