Previous Section Table of Contents Next Section

Reviewing the Component

Given the nasty things people can do with script viruses, I never run a component without looking at it first. Opening MSG.wsc in PrimalScript, or simply reviewing the source code online, reveals a relatively simple script. It's in VBScript, so I can more or less follow what it's doing. I don't see any FileSystemObject calls to delete everything on the computer, any code that looks like it's going to send an e-mail to everyone in my address book, and so forth.

Reviewing the component also allows me to see what methods and properties it offers. In this case, I can get that information from the Web site where the component is found, but that might not be the case for every component you run across. Looking through this component in PrimalScript, I can see its interfaces. As shown in Figure 26.1, PrimalScript lists each method and property in its left-hand tree. You can click on any one to jump straight to the code that implements each. This script appears to implement the following:

  • A Show method

  • A Write() method, which accepts a line of text as a parameter

  • A Clear method

  • Several properties such as Top and Left, which appear to set the size of the dialog box

  • A number of other useful-looking properties and methods

Figure 26.1. Reviewing a script component's interfaces

graphics/26fig01.jpg

    Previous Section Table of Contents Next Section