News
Map
About

 


A Few More Tips

An UpdateCustomMenu Script

Instead of typing a script into the Quick Script window every time you import a new and improved Custom Menu, create a new script in user.command that does it for you. Here's the script:

on UpdateCustomMenu ()
   menu.remove( @user.menus.customMenu )
   menu.install( @user.menus.customMenu )
UpdateCustomMenu ()
This is the same script you used on the previous page to update your Custom Menu. Create a new item in your Custom Menu just above the "Edit Menu" item; set its name to "Update Menu" and its script to user.command.UpdateCustomMenu().

Now all you need to do to import and update your new and improved menu is:

  • Open the user.command.fttb file. Close the user.command window when it opens.
  • Open the menus.customMenu.ftmb file. Close the user.menus.customMenu outline when it opens.
  • Select Update Menu from your Custom Menu. The script will remove the old menu and install the new one, and you're ready to roll!

Of course, the first time you import a Custom Menu with the Update Menu command, it won't be on the old menu yet, so you'll have to run the script from user.command manually. Either run the script user.command.UpdateCustomMenu() from the Quick Script window, or select the script at user.command.UpdateCustomMenu and use the Main->Run Selection (or (Cmd)[Ctrl]-3).


NOTE: When the Custom Menu is removed from and re-added to the menubar, it may move to a new position on the menubar. This is because menu.install() is used to add the modal menus (WP, Table, etc.) as well as the Custom Menu. The last menu added using menu.install() will become the rightmost menu before the Window menu. It's nothing to worry about--it'll move back when Frontier swaps in a different modal menu.

Disabled Menu Items

In our introduction to the Custom Menu, we saw that a menu item whose item text begins with a hyphen ("-") becomes a dividing line in the menu. It is also possible to show a menu item, but have it disabled ("grayed out").

To disable any menu item, you can put an opening parenthesis ("(") at the beginning of the item text.

You're Not Alone

Watch for tools you can use or adapt in the various Frontier mailing lists. Users often post scripts they have written or modified to the Frontier-Community list, for example.

And if you create a tool that you think others might have a use for, a posting to the Frontier-Community list should get you kudos, quick feedback, and probably requests for more. The Frontier scripting community is very much about sharing tools, so please join in!

There's a brief blurb about the author, but feel free to ignore it.



Page 1: The Custom Menu
Page 2: Organizing Your Custom Menu
Page 3: Organizing Your Custom Scripts
Page 4: Custom Menu Management Approach
Page 5: How to Clone Your Custom Menu
Page 6: A Few More Tips
Page 7: About the Author


News - Map - About ScriptMeridian

This tutorial was written by Samuel Reynolds in Parker, CO, USA.
Page last revised 1998/09/27; 11:24:39 AM.
Copyright © 1998 ScriptMeridian. All rights reserved
All trademarks are the property of their respective owners.
11:33:10 AM 27 September 1998