The Main menu is the first of several customizable menus in the Frontier environment. It includes a number of menu options you'll find essential as you write scripts in Frontier.
Frontier's Main Menu
About this Menu
This command displays a dialog that explains the purpose of the Main menu, and links to this web page.
The New Script command opens a dialog (new in Frontier 4.1) that makes it easy to create a new script, in either UserTalk or AppleScript.
Given the settings as shown above, when you click on the OK button, a new UserTalk script will be created in the system.agents table.
Here's the Kind popup menu:
And here's the Language popup menu:
When you want to create a new script press cmd-N. Choose a Kind, choose a language, click on OK. Edit the script. Debug. Run. Use.
The Export command opens a dialog (new in Frontier 4.1) that allows you to export any object from Frontier's object database to the Macintosh file system, or as an attachment to a Eudora email message.
Open a window, or place the table cursor on the item you want to export. If you want to export a different item, enter its address in the dialog.
- The normal format is Packed object. It creates a file that is imported when it's double-clicked on. Desktop scripts run when they're double-clicked on.
- For large tables with lots of sub-tables choose Folder. This is a new export format supported in Frontier 4.0. To import such a folder, write a desktop script that calls export.importFolder.
- You can export a script in a format compatible with Apple's Script Editor. This is a standard format that's supported by all AppleScript editors, including Frontier. [You can import Script Editor files by changing the creator ID of the file to 'LAND' and double-clicking on it in the Finder.]
- The normal location is File. When you click on OK, a standard file dialog appears.
- You can also direct the exported object to a Eudora email message.
You can choose no compression, to compress the resulting file using StuffIt 3.5 or greater; or to compress it and then BinHex the resulting file.
Objects that are exported this way can be imported into Frontier by double-clicking on the file in the Finder. The objects contain information that route them to the correct object database location. Frontier will not overwrite any data without confirmation.
Run Selection, or Command-/, has slightly different behavior depending on the type of the frontmost Frontier window. In a word processing text document, it runs the exact selection, putting the result as a message in the main window. In outline windows, this command runs the entire line (independent of the exact selection) and places the generated value as the first subhead of the line. In menubar windows, the script linked to the item is run. In table windows, the selected string or script is run if possible.
Edit with App
Edit with App, or Command-E, is a new command in Frontier 4.1. It allows you to edit AppleScripts, text windows and strings, and MacBird cards, using external editors.
When you save your changes in any of these editors, the result is saved into the object database, not the file system. If you're wondering how we did this, it's not a hack, we worked with the developers of each of these products to make them work well with Frontier.
- If you press Cmd-E with an AppleScript window open in Frontier, or with the table cursor pointing at an AppleScript, Frontier launches a compatible AppleScript editor and sends it a message to edit the script you've selected. We've tested this command with Late Night Software's Script Debugger the same protocol may work with other AppleScript editors.
- If you choose Edit with App with a wptext window open or highlighted in its table, Frontier will open the object in a compatible text editor. We've tested this with BBEdit 4.0 and greater.
- If you choose a binary object whose sub-type is CARD, Frontier will launch the (new in 4.1) MacBird card editor to edit the card. (It's in the UserLand Utilities folder.)
Find & Replace
Find & Replace is a hierarchical menu. All of this item's sub-menus have Command-key equivalents and you'll probably find yourself using the find-replace capability in Frontier much more often with those keyboard shortcuts than with the menu options.
Command-F invokes the Find & Replace Dialog option, which in turn displays a dialog like the one shown below.
Command-G repeats the last find operation from the current cursor position, looking for the next occurrence of the string for which you are searching. Command-H carries out the replacement operation called for in the Find & Replace dialog and then repeats the last find operation from the current cursor position.
How much of the Object Database is searched? That depends on what window is frontmost when you invoke the operation. The following table summarizes the scope of the Find & Replace operation.
|Find & Replace Invoked In...||Has Scope Of...
|Main Window||Entire Object Database
|Table Window||That table and all of its sub-tables, and so on until last sub-table is searched
|Menubar Window||That window plus all of its scripts
|Outline, Script or Word Processing Window||That window
The Common Styles hierarchical menu allows you to change the font and size of an outline, script, table, or word processing selection to one of the most common style combinations, Geneva 9-point, Geneva 12, Palatino 12 or Helvetica 18. All of these commands have Command-keystrokes.
We encourage you to change these entries to suit your own style and preferences for font and size combinations. To do so, hold down the Option key while selecting the command to open one of these scripts. They all look the same except for their specific font and size contents. Here's the one for 9-point Geneva, for example:
By editing either or both of these lines of script to call for a different type and/or size, you can customize this menu easily. Don't forget to rename the menu item so you'll remember what it does. You could also add your own styles to this menu by copying a script from one of the existing entries and then editing it after attaching it to a newly created entry in the menu.
The AppleScripts hierarchical menu, new in Frontier 4.1, adds important commands for AppleScript writing and development in the Frontier environment. For more information see the Working with AppleScript page.
The Misc sub-menu contains miscellaneous commands, and it's also a place where we can add new commands in the future. The first command restarts the Macintosh OS Finder. Programmers sometimes need to do this. It happens. (This is a family-oriented manual.)
Insert Date/Time is a useful command when you want to add the current date and time to the text you're editing. It has a single-keystroke, Cmd-4. I'll press it right now. Fri, Sep 27, 1996 at 4:08:42 AM by DW. It works! You can do it too.
The last two items in this menu are for the tutorial, they are used in the Tutorial website to illustrate how to write scripts that run from the menubar.
This command displays a dialog asking if you want to turn off Agent scripts.
An agent script is an AppleScript or UserTalk script that runs as a background process, repeating its operations at specified intervals (see the Agents page).
Important: If agents are turned off, Frontier's automatic changing of menus based on which window is frontmost (discussed in Chapter 7 of the tutorial) will not work. That behavior depends on an agent script.
You may want to disable agents when one or more of them is misbehaving in some way and you want to track the problem down. Running without agents turned on is like starting up the Macintosh OS with extensions disabled (except you don't have to restart Frontier to do it).
When agents are disabled, this command changes to Enable agents, and it leads to a dialog that allows you to turn them on again.
All agent scripts are either running or not as a group. You cannot turn one agent off and leave others on -- although you can cut an agent script from the agents table and paste it somewhere else for later retrieval.
You can open the agents table by Jumping to system.agents, or using the Main Navigator thru The Open Menu.
After confirmation, the Backup command creates a copy of Frontier.Root in a sub-folder of the folder that contains the Frontier application. The sub-folder is named "backups."
The backups are serialized (e.g. Frontier.Root.361, Frontier.Root.362), so as you work, you leave a trail behind you.
Backing up is important, and this command makes it simple to do. Just press Command-B to be sure your changes are safe.
Little-known feature: If you have a script at people.[user.initials].customBackup, the Backup command will run that script after it's created the backup. It leaves the path for the backup file in backups.lastfile. Some Frontier users have this script compress the file with StuffIt, and then delete the original, to minimize the space taken by backups.
When you choose the DocServer command from the Main menu, a dialog appears asking:
Frontier launches the DocServer app (it's in the UserLand Utilities folder) and sends it an Apple Event to display the page you entered in the dialog.
More information is on the DocServer page.
© Copyright 1996-97 UserLand Software. This page was last built on 5/7/97; 1:12:53 PM.
It was originally posted on 9/27/96; 4:43:13 AM.
Internet service provided by Conxion.