VBScript Scripts written in VBScript are plain text files that can be viewed with any text editor. They can be executed on any Windows system that has the Windows Scripting Host (WSH) installed. The WSH is installed by default on Windows 98/NT 4 and later versions. VBScript files have the extension “.vbs”. Executing a VBScript To execute a VBScript script, you have three options: 1 Double-click on the VBScript file. 2 On the command line, type the full file path followed by the scripts command line parameters. 3 In the Windows Run dialog, type “cscript” with a space behind it followed by the full file path of the script and its command line parameters. CScript is a program that executes scripting files. VBScript scripts can only have very simple dialogs as the user inter- face. Since our example script needs the source and destination fold- ers as input from the user, you have to supply them as command line arguments. The first argument specifies the source folder and the sec- ond argument specifies the destination folder for the downsampled images. Since double-clicking on a scripting file does not support arguments, we have to use either option 2 or option 3 to execute the script. To view the VBScript version of the Downsample script, open the file ExampleScripts\Downsample\VBScript\dwnsm- ple.vbs. with any text editor. Let’s assume that you copied this script to the following location: C:\VBScripts\dwnsmpl.vbs Let’s further assume that you have some JPEG files at: C:\JPEGs\ Let’s also assume that the following destination folder exists: C:\ds_JPEGs\ You can execute the script now in two ways: •   Open a Command Prompt window and type the line : C:> C:\VBScripts\dwnsmpl.vbs C:\JPEGs C:\ds_JPEGs
Canvas 8 Help: Writing Scripts for Canvas (10 of 16)                                                Page #752