I use some custom shortcut keys in KeyEventTranslations.tr. One is for the Delete All Output function:
Item[KeyEvent["w", Modifiers -> {Control}],
FrontEnd`FrontEndExecute[FrontEnd`FrontEndToken["DeleteGeneratedCells"]]]
or simply:
Item[KeyEvent["w", Modifiers -> {Control}], "DeleteGeneratedCells"]
This works as expected, putting up the dialog: "Do you really want to delete all the output cells in the notebook?". Is there any way to set up KeyEventTranslations.tr that when I hit Ctrl+w the dialog is automatically acknowledged and I don't have to hit Enter? The same goes for the Quit kernel function, that also puts up a dialog.
Item[KeyEvent["w", Modifiers -> {Control}], "DeleteGeneratedCells"]– Mr.Wizard Feb 19 '12 at 12:22FrontEndXxxfunctions are not necessary? – István Zachar Feb 19 '12 at 14:26somethingandFrontEnd`something. Maybe the only difference is that the latter form does not get evaluated in the kernel, but both of them might be evaluatable in the front end. I haven't dug deep into this. http://reference.wolfram.com/mathematica/tutorial/ExecutingNotebookCommandsDirectlyInTheFrontEnd.html – Szabolcs Feb 19 '12 at 15:31IteminKeyEventTranslations.tris a FrontEnd token. As far as I know you do need the form you show if you are going to string several of them together, for example. – Mr.Wizard Feb 19 '12 at 15:50