# About AppleScript and Internet Explorer 5

AppleScript is a scripting language for automating tasks on Apple Macintosh computers. It is useful in cases where you need to repeatedly perform a procedure that has many steps. It is also useful when you need to use two or more Macintosh application programs together to accomplish your work.

This document is written for use with AppleScript, but also applies to scripting Microsoft Internet Explorer with Frontier, Perl, and QuicKeys, or to scripting it by directly sending AppleEvents. It is meant to supplement the Microsoft Internet Explorer 5 AppleScript Reference.

## Documentation

### General AppleScript Documentation

This document assumes you’re already familiar with AppleScript and know how to use the Macintosh Script Editor to browse scripting dictionaries and to create and debug scripts. If you haven’t used AppleScript before, you should study at least one of the following:

- AppleScript for the Internet by Ethan Wilde (Peachpit Press, 1998, ISBN 0-201-35359-8). An excellent introduction to scripting Internet applications on the Macintosh. It contains chapters with information on scripting Microsoft Outlook Express and Microsoft Internet Explorer, as well as on scripting basic Apple Internet software such as Open Transport. It also contains a thorough introduction to the AppleScript language itself. Highly recommended.
- AppleScript for Dummies by Tom Trinko (IDG Books, 1995, ISBN 1-56884-975-3). A solid tutorial on AppleScript for the novice, and available from most large bookstores.
- The Apple Computer AppleScript site: Here you will find links to many other sources of information on AppleScript and scripting the Macintosh, including overviews, tutorials, and AppleScript-related utility software.
- The Apple Computer AppleScript for Scripters site: Here you can download the three official AppleScript manuals published by Apple: the AppleScript Language Guide, which documents AppleScript itself; the AppleScript Scripting Additions Guide, which documents official Apple extensions to the AppleScript language; and the AppleScript Finder Guide, which documents scripting the Finder. These books are essential reading for scripters at any level of ability, and are available free of charge in a number of formats, including printable Adobe Acrobat PDF (Portable Document Format) files.

### AppleScript Documentation for Internet Explorer

To learn about the scripting classes and commands provided by Microsoft Internet Explorer, read the Microsoft Internet Explorer 5 AppleScript Reference. This document contains essentially all of the information in the AppleScript dictionary of Internet Explorer in an accessible format, including all of its AppleScript words, as well as code examples and explanatory material for obscure commands.

You may also find information on scripting Internet Explorer in the Usenet newsgroup microsoft.public.inetexplorer.mac. Internet Explorer users and scripters congregate here and can often answer tough questions.

## Scripting Internet Explorer 5

### Scripting Tips and Tricks

#### Debugging Scripts

Be sure to keep both the Script Editor’s result window and its event log window open at all times when creating and debugging a new script. They may display valuable information.

#### Using Variables and Parentheses

Break complicated expressions into parts and store each part in a variable. For example, you might break this command:

        set V to the W of the X of the Y of the Z

into:

        set V1 to the Y of the Z
        set V2 to the X of the V1
        set V to the W of the V2

This will make your script much easier to debug. Note that in some cases it may result in your script running slightly more slowly, however.

Also, use parentheses wherever appropriate to make explicit any assumptions you have about the order of evaluation in expressions.