RE: Re: Manipulating the Front End
- To: mathgroup at smc.vnet.net
- Subject: [mg47061] RE: [mg47045] Re: Manipulating the Front End
- From: JonasB at iui.se
- Date: Mon, 22 Mar 2004 22:39:18 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
The Help Browser documents some commands in the *.tr files, but not all. It does not document the *.tr files (with load order etc). With better documentation, perhaps one could improve Mathematica's rather crappy support keyboard shortcuts with non-US keyboards. Customization does not seem all that hard. Just by guessing, I have managed to add a couple of keyboard shortcuts I find very useful. By adding the following lines to KeyEventTranslations.tr, Ctrl-[ inserts matching [] around text, and Ctrl-] inserts matching {}. Item[KeyEvent["[", Modifiers -> {Control}], FrontEndExecute[{ FrontEnd`NotebookApply[SelectedNotebook[], "[\[SelectionPlaceholder]]", Placeholder] }]], Item[KeyEvent["]", Modifiers -> {Control}], FrontEndExecute[{ FrontEnd`NotebookApply[SelectedNotebook[], "{\[SelectionPlaceholder]}", Placeholder] }]], Matching braces is a fundamental problem in all programming.:-) Jonas > -----Original Message----- > From: Steve Luttrell [mailto:steve1 at _removemefirst_luttrell.org.uk] To: mathgroup at smc.vnet.net > Sent: den 22 mars 2004 11:19 > To: mathgroup at smc.vnet.net > Subject: [mg47061] [mg47045] Re: Manipulating the Front End > > > In version 5 you will find all of the Front End tokens > documented in the Help Browser. Select the "FrontEnd" tab, > then the 6th entry in the left hand pane is "Front End > Tokens". You invoke these commands using FrontEndTokenExecute. > > Steve Luttrell > > <JonasB at iui.se> wrote in message news:c3h19u$bad$1 at smc.vnet.net... > > Does anyone know where can I find a complete documentation of the > > FrontEnd programming features? There is a little in the Mathematica > > book and in the online documentation, but it is by no means > complete. > > Too often, like for example in section 2.11.4 of the > manual, you see > > tables listing: > > > > "A few named commands that can be given to the front end. These > > commands usually correspond to menu items." > > > > But where do I find _all_ the named commands? > > > > I want to create keyboard macros for things I type often. > (There are > > palettes, I know, but...) Quite a bit can be learned by > simply looking > > at the *.tr files, but there is too much guesswork. Editing > > DefaultFrontEndInit.tr was simple enough, Esc-si-Esc is replaced by > > "//Simplify" if: > > > > "si"->"//Simplify", > > > > is added to the InputAliases. Since I would prefer to have Ctrl-Alt > > combinations than Escaping all the time, I started looking at > > KeyEventTranslations.tr. I managed to get "//Simplify" > written when I > > type Control-h by adding: > > > > Item[KeyEvent["h", Modifiers -> {Control}], > > FrontEndExecute[{ > > FrontEnd`NotebookWrite[SelectedNotebook[], > > "//Simplify"] > > }]], > > > > Unfortunately, I could not get any Ctrl-Alt combination to work by > > setting Modifiers -> {Control, Option}. Does anybody have any > > suggestions? > > > > Jonas > > > > > -----Original Message----- > > > From: Omega Consulting [mailto:info at omegaconsultinggroup.com] To: mathgroup at smc.vnet.net > To: mathgroup at smc.vnet.net > > > Sent: den 12 februari 2004 13:16 > > > To: mathgroup at smc.vnet.net > > > Subject: [mg47061] [mg47045] Formatting notebooks for > > > Menu File:New? > > > > > > > > > At 05:05 AM 1/16/2004, jose flanigan wrote: > > > >hi, > > > > > > > >I put some notebook formatting commands in the autoload init.m. > > > >This formats the initial notebooks when I start Mathematica 5.0 > > > >from scratch. However, it does not format the new > notebooks I start > > > >by clicking on File:New. > > > > > > > >Do you know how I can control the format of the notebooks > > > started with > > > >the File:New menu command? > > > > > > > >Thanks in advance. > > > > > > The actions of the menus are controlled by the MenuSetup.tr file. > > > The file is in SystemFiles/FrontEnd/TextResources or the > > > platform-specific subdirectory. The action associated > with each of > > > the menu items can be any > > > frontend command. Change the line: > > > > > > Item["&New", "New", MenuKey["n", Modifiers->{Control}]] > > > > > > to > > > > > > Item["&New", > > > FrontEndExecute[{NotebookCreate[WindowSize->{100,100}]}], > > > MenuKey["n", Modifiers->{Control}]] > > > > > > -------------------------------------------------------------- > > > Omega Consulting > > > "The final answer to your Mathematica needs" > > > http://omegaconsultinggroup.com > > > > > >