[ Home | Prev | Next ]

Chapter 5: continued


Frontier Install Scripts

As a UserTalk script writer, you will generally not have to be concerned with the inner operations of install scripts for external applications you wish to control. But in case you are curious, let's take a quick look at where they are stored and what they look like.

Figure 5-2 shows part of the system.verbs.apps table where install scripts are stored.


Figure 5-2. The Install Scripts Table in Frontier

Let's open the install table for BarChart (e.g. type Cmd-J then "BarChart", click OK). It looks like Figure 5-3.


Figure 5-3. BarChart Install Table

Just from their name, you can probably determine what most of these install scripts will let you tell BarChart to do.

Just for fun, let's take a look at one of these install scripts. Double-click the item marker next to the script newWindow. The script looks like this:

This is a fairly normal-looking UserTalk script, not unlike many others we've seen in this book. It uses a "generic" newWindow verb (common to utilities created by UserLand) in the app table to create a new window, then makes sure it is able to set up a window to accommodate the desired number of bars and units. Notice that this script calls BarChart.setBarCount. Let's open that install script by Command-double-clicking on the verb's name in the newWindow script. It looks like this:

Now this script looks a good bit different from other scripts we've seen, at least in its operational line. The first line is familiar-looking. The second line is typical of install scripts in Frontier. It uses a call to Frontier's appleEvent verb (which handles Apple Events), passes it some information about what the verb wants to do and what application it wants to use, and returns the result of that call.

Creating & editing install scripts can be left to Frontier experts. We've given you a short peek behind the scenes to help you understand how scriptable applications are controlled from Frontier.

What About My Application?

Entire chapters or even books could be written for each scriptable application. With the information you learned in this chapter, you should be able to browse any application table and try out some of the verbs. Some applications include excellent scripting documentation, some depend on notes written by a few dedicated volunteers, others include nothing. Perhaps you will be one of the volunteers! Chapter 1 offers pointers to sources of information.
Contents Page | Previous Section | Next Chapter -- The Object Database
HTML formatting by Steven Noreyko January 1996, User Guide revised by UserLand June 1996