2.11.4 Manipulating the Front End from the Kernel
| $FrontEnd | the front end currently in use | | Options[$FrontEnd, option] | the setting for a global option in the front end | | AbsoluteOptions[$FrontEnd, option] | the absolute setting for an option |
SetOptions[$FrontEnd, option->value]
| | reset an option in the front end |
Manipulating global options in the front end. Just like cells and notebooks, the complete Mathematica front end has various options, which you can look at and manipulate from the kernel. | This gives the object corresponding to the front end currently in use. | |
Out[1]=
|
|
| This gives the current directory used by the front end for notebook files. | |
In[2]:=
Options[$FrontEnd, NotebookDirectory]
|
Out[2]=
|
|
| option | default value | | | NotebookDirectory | (system dependent) | the default directory for opening and saving notebook files | | NotebookPath | (system dependent) | the path to search when trying to open notebooks | | Language | "English" | default language for text | | MessageOptions | (list of settings) | how to handle various help and warning messages |
A few global options for the Mathematica front end. By using NotebookWrite you can effectively input to the front end any ordinary text that you can enter on the keyboard. FrontEndTokenExecute allows you to send from the kernel any command that the front end can execute. These commands include both menu items and control sequences.
| FrontEndTokenExecute["name"] | execute a named command in the front end |
Executing a named command in the front end.
| "Indent" | indent all selected lines by one tab | | "NotebookStatisticsDialog" | display statistics about the current notebook | | "OpenCloseGroup" | toggle a cell group between open and closed | | "CellSplit" | split a cell in two at the current insertion point | | "DuplicatePreviousInput" | create a new cell which is a duplicate of the nearest input cell above | | "FindDialog" | bring up the find dialog | | "ColorSelectorDialog" | bring up the color selector dialog | | "GraphicsAlign" | align selected graphics | | "CompleteSelection" | complete the command name that is the current selection |
A few named commands that can be given to the front end. These commands usually correspond to menu items.
|