FrontEndExecute[expr]
sends expr to be executed by the Wolfram System front end.
FrontEndExecute
FrontEndExecute[expr]
sends expr to be executed by the Wolfram System front end.
Details
- FrontEndExecute[expr] sends expr to $FrontEnd via WSTP using LinkWrite.
- The standard Wolfram System front end can handle only specific notebook manipulation commands such as NotebookApply, NotebookLocate and SelectedNotebook. It uses the versions of these commands in the FrontEnd` context.
- FrontEndExecute[FrontEndToken["name"]] executes named commands in the front end, typically corresponding to menu items.
Examples
open all close allBasic Examples (2)
This calls the front end's CellPrint function:
FrontEndExecute[FrontEnd`CellPrint[Cell["A", "Text"]]]Create a notebook with two cells:
nb = CreateDocument[{"line1", "line2"}];SelectionMove[nb, All, Notebook]Merge the cells by using a FrontEndToken:
FrontEndExecute[FrontEndToken[nb, "CellMerge"]]Properties & Relations (2)
Use FrontEndExecute to do a sequence of front end functions:
nb = FrontEndExecute[FrontEnd`NotebookCreateReturnObject[]];FrontEndExecute[FrontEnd`NotebookWrite[nb, "text"]]FrontEndExecute[FrontEnd`SelectionMove[nb, All, Cell]]FrontEndExecute[FrontEnd`NotebookDelete[nb]]Carry out the same steps by kernel functions:
nb = CreateDocument[];NotebookWrite[nb, "text"]SelectionMove[nb, All, Cell]NotebookDelete[nb]History
Introduced in 1996 (3.0)
Text
Wolfram Research (1996), FrontEndExecute, Wolfram Language function, https://reference.wolfram.com/language/ref/FrontEndExecute.html.
CMS
Wolfram Language. 1996. "FrontEndExecute." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/FrontEndExecute.html.
APA
Wolfram Language. (1996). FrontEndExecute. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FrontEndExecute.html
BibTeX
@misc{reference.wolfram_2026_frontendexecute, author="Wolfram Research", title="{FrontEndExecute}", year="1996", howpublished="\url{https://reference.wolfram.com/language/ref/FrontEndExecute.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_frontendexecute, organization={Wolfram Research}, title={FrontEndExecute}, year={1996}, url={https://reference.wolfram.com/language/ref/FrontEndExecute.html}, note=[Accessed: 13-June-2026]}