Re: Urgent! Add Keyboard command to Mathematica FrontEnd (Mac)
- To: mathgroup at smc.vnet.net
- Subject: [mg17064] Re: Urgent! Add Keyboard command to Mathematica FrontEnd (Mac)
- From: "P.J. Hinton" <paulh>
- Date: Fri, 23 Apr 1999 02:32:06 -0400
- Organization: "Wolfram Research, Inc."
- References: <innclip7fh2de$h1o@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
On 20 Apr 1999, Yohon Lo wrote: > Hi, I need help on how to add keyboard command to mathematica FrontEnd for > Macintosh. I want to add a key command for Save Selection As: Adobe > Illustrator funtion, Function Key 12 or command-control-s. > > The MenuSetup.ml file is in text format, and I am have a hard time reading > it. Any advices? > > Or hints on Creating a Palatte window to click on. Paste this expression into a Mathematica 3.0 notebook and evaluate it. This will create a button that, when clicked, will perform the same operation as the front end menu command sequence Edit -> Save Selection As -> Adobe Illustrator. ButtonBox[ StyleBox[ "Save Selection as\nAdobe Illustrator", FontFamily -> "Helvetica" ], ButtonFunction :> FrontEndExecute[{ FrontEndToken[ FrontEnd`InputNotebook[], "SelectionSaveSpecial", "Illustrator" ] }], ButtonEvaluator -> None, Active -> True ] // DisplayForm Alternatively, you can copy the file: ToFileName[{$TopDirectory, "SystemFiles", "FrontEnd", "TextResources"}, "MenuSetup.tr"] to a newly created folder with path: ToFileName[{$PreferencesDirectory, "SystemFiles", "FrontEnd", "TextResources"}] And edit this file by adding the following Item: Item[ KeyEvent["s", Modifiers -> {Command, Control}], FrontEndExecute[{ FrontEndToken[ FrontEnd`InputNotebook[], "SelectionSaveSpecial", "Illustrator" ] }] ] Be sure to add a comma after the Item[] expression if it is not at the end of the list that contains all of the Item[] expressions. For more information on the use of FrontEndToken[] expressions like those above, see _The Beginner's Guide to Mathematica Version 3_ by Glynn and Gray, Chapter 56. -- P.J. Hinton Mathematica Programming Group paulh at wolfram.com Wolfram Research, Inc. http://www.wolfram.com/~paulh/ Disclaimer: Opinions expressed herein are those of the author alone.