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 Internet Explorer with Frontier and QuicKeys, or to scripting it by directly sending Apple Events.

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 Documentation for Internet Explorer

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


Scripting Internet Explorer 5

Overview

You can see what commands, classes, and properties are implemented in Internet Explorer by opening the AppleScript Script Editor application that came with your Macintosh, selecting Open Dictionary... on the File menu, and then choosing Internet Explorer, which opens the AppleScript dictionary for Internet Explorer. 

If you want more information on AppleScript commands than appears in the Internet Explorer dictionary, you can read the AppleScript Reference for Internet Explorer 5, which goes into more detail. 

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 the second example may be somewhat slower, because it must send three AppleEvents to Internet Explorer instead of only one.

Use parentheses wherever possible to control the order of evaluation in expressions.