
Companion Pages --> Scripting Guide / Scripting Archive / Index
You've learned HTML and created your home page and even helped your students to make their pages. You've linked to marvelous resources for language learners out there on the Web. But you're hungry for more. Maybe you want to give users the ability to provide feedback to you or your students, or you want to set up a mechanism for your students to interact with one another -- in that case CGI scripting may be what you want, and you can take a look at the Li Guide and Archive for some ideas on what's involved in learning to use CGI and what kinds of things you could do. You might want to also look at the combination of using CGI scripts (which are housed on a server) with local ("client-side") scripts (which run off the Web browser on the user's computer) using JavaScript.However, maybe you don't need or want the kind of interactivity CGI or JavaScript can offer -- you want instead (or in addition) for your students to be able to jump from your Web pages to other computer programs which have functions that a Web browser doesn't have. Maybe you have some HyperCard stacks you'd like your students to use which offer interactive grammar or vocabulary drills (such as the LinguaRom stacks from Hyperglot). Or you want your students to be able to write an essay in Microsoft Word or WordPerfect, using a spell checker in the target language -- and then maybe to get help with that document from Système-D or Atajo -- and finally to submit that as a contribution to a class chat session (via a CGI script such as WebChat) or as a homework assignment to the instructor.

Of course, a student can simply go and start up programs totally independently of the Web browser. But it's nice to give students a "home base" from which to find all the resources they need and also to provide a uniform access to those resources. Through program linking to a Web page, students can start up external programs the same way they link to Web resources -- this makes the process of using those programs alongside the Web browser transparent. Having the Web browser active at the same time as a word processor allows students more easily to cut and paste between applications, thus taking advantage of the individual strengths and features of each.

How do computers need to be configured to do this?
What do you need to be able to do this? One very important pre-requisite is that the memory capacity (RAM) of the computers the students are using must be sufficient to run a Web browser such as Netscape at the same time as the external program you want to make available. Obviously, if you want to have more than two programs active on the same time, it requires even more memory. You also will need to know what the memory requirements of your Web browser and of your external programs are. If you don't have sufficient memory, one alternative to the expensive solution of purchasing additional RAM for your student machines is to use a programs such as RamDoubler which successfully tricks your computer into thinking it has more memory than it does.

Configuring external programs as helper applications
How do you actually link the programs? There are a number of ways to do this, some easier than others. The simplest is to set up the external program as a helper application for your Web browser. That way, when a student clicks on a link to a document created with application "x", the browser first downloads the document to the student's computer, and then launches application "x" to view it. Actually browsers are configured "out of the box" to recognize a number of document types and to start up the appropriate application. Netscape Navigator, for example, will launch Microsoft Word when linking to a document with the ".doc" suffix or will start up Excel when encountering a file name ending in ".xls". This is, in fact, how applications are called to handle playback of audio and video files. You are not restricted to the helper applications already registered with your browser -- others can be added through the "Options" or "Preferences" menu. You could, for instance, instruct your browser to start up Système-D by adding it as a helper application with a new suffix such as ".syd". Using this system pre-supposes that the user has the required application already installed -- obviously a Microsoft Word document will not be retrievable unless Word -- or another program which can read Word files -- is installed.

For programs created with authoring languages such as HyperCard, Toolbook or Authorware, you would probably want to configure the stacks or programs to use the "run-time" versions (or "players") of these programs. With some of these programs, it is also possible to save your creation as a self-contained (executable or clickable) program, which eliminates the necessity for the user to have the player installed. On the other hand, players usually can be distributed freely (assuming you have purchased the full program) and non stand-alone programs are smaller in size and therefore faster in downloading over the Web. You will need to experiment to see how well players are able to be launched with the targeted document. In my experience, for example, Netscape for Windows can successfully launch the Authorware player, while the Mac version starts up the player, but does not automatically call up the downloaded Authorware program.

An alternative to configuring programs as helper applications is to use an intermediary program to act as a go-between for your browser and the external programs. This is necessary in cases, as in the example above of the Mac version of Authorware, when external applications aren't configurable to launch downloaded documents automatically. In the case of the recalcitrant Authorware program, I wrote a small AppleScript program which launches Authorware with the appropriate document through the use of a utility called Flypaper. Flypaper in fact can be used to launch any program on a Mac. A similar utility by the same author, WebRunner, also launches programs through the use AppleScript, but actually sends the AppleScript code as a URL which WebRunner then executes on the user's machine. This is not as secure a method as Flypaper, since you may find yourself clicking on URL's containing AppleScript which when run will do things on your computer that you wouldn't want done. Flypaper, in contrast, requires that the AppleScript code reside (as an application) on the user's machine -- which means that AppleScript application must be first downloaded by the user.On the Windows side, there is an application created at IAT called WebApp which automatically downloads and runs external programs on a Windows browser. There is also a beta Mac version. An example of an external application which you might want to launch in this way from a Web page is the teleconferencing program CU-SeeMe. I have used intermediary programs to launch CU-SeeMe from a Web page and tell it to go to a specific site (in this case my office). On the Mac Webrunner code was used, while on Windows GoCUSM performed the same function.

Interactions between a Web browser and an external application need not be one-way. With many applications, you can also link back to Web pages for your browser to display. Students can thus move easily back and forth between an external application and a Web browser. One of the easier applications to do this with is HyperCard. Since HyperCard scripts can be written in AppleScript, you can easily write a short script to open a URL from within a HyperCard stack. This can be done with other Mac apps though through use of Flypaper. If anyone has found a good way to do this in Windows (with Visual Basic?), I'm eager to hear about it.

Besides calling up external applications, the next generation of Web browsers supports display of external documents (not just HTML) within the browser window itself. Microsoft's Internet Explorer is capable of playing directly audio (WAVE) and video (AVI) files. Netscape Navigator 2.0 features plug-ins which, for example, allow in-line display of QuickTime movies, Director movies (Shockwave) and RealAudio sound files. This allows for seamless integration of HTML-based text with a variety of other documents. To use the Netscape plug-ins, you need to download the appropriate plug-in for the program you want to view and for the platform you are using. For the very ambitious, it is possible to write your own plug-in for further customization of your Netscape window. Of course, one of the most exciting plug-ins is Java. Java applets can be written to do just about anything you could imagine and are slated to be supported by a variety of Web browsers. However, writing Java applets is not for the faint-hearted -- Java is a programming language very similar to C. It's not likely that the average language instructor will be able to jump in and write Java code, even with previous experience with a scripting environment such as Toolbook orHyperCard. For those interested in seeing what's involved, a good place to start would be to look at some JavaScript code, which is a somewhat simplified version of Java. To use JavaScript you also don't need to have a compiler, as you do with Java; JavaScript is directly embedded in HTML and interpreted by the Web browser when a Web page containing it is called.
