Executing A Script - MACROMEDIA HOMESITE Using Manual

For windows 98, windows me, windows nt 4.0, windows 2000, and windows xp
Table of Contents

Advertisement

Writing and executing scripts
The program determines which language engine to use based on the extension of the
script file. If the file extension is BAS, VB, or VBS, the VBScript engine executes the
script. Otherwise, the program uses the JScript engine.
To automate HomeSite+ for Dreamweaver MX tasks, you must familiarize yourself
with the Visual Tools Object Model (VTOM). The main object is the Application
object. The Application object contains two important child objects, the
ActiveDocument object and the DocumentCache object. You can use these objects
to write scripts for common tasks.
In addition, the Application object contains a number of toolbar-related functions,
which enable you to create toolbars dynamically.
For best performance, you should create an Application object variable and use it
throughout the script rather than continually referencing the Application object
directly.
For example, the following code creates an Application object variable in JScript:
function Main() {
The following code creates an Application object variable in VBScript:
Sub Main
End Sub
The Application object is only available from scripts that are executed within
HomeSite+ for Dreamweaver MX.
To access the Application object from an external program, use the language's
equivalent of
Note
When writing and editing VTOM scripts and when porting code from VBScript,
remember that JScript is case-sensitive.

Executing a script

If the scripting engine encounters an error while executing your custom script, the
script file opens in the Editor with the error line highlighted. In addition, information
about the error displays in the status bar, which helps you debug the problem.
In the Customization dialog box, the Keyboard Shortcuts tab includes a shortcut
(Shift + Ctrl + Q) for the Execute current document as ActiveScript command. You
can use this command to pass the current document to the ActiveScripting engine,
which provides you with a tool for debugging your scripts. As with toolbutton-based
scripts, the scripting language is determined by the file extension of the current
document.
var app = Application; //create application object variable
app.WindowState = 2; //maximize the window
Dim app
set app = Application 'create application object variable
app.WindowState = 2 'maximize the window
CreateObject("AllaireClientApp.TAllaireClientApp"
225
).

Advertisement

Table of Contents
loading

This manual is also suitable for:

Homesite+ for dreamweaver mx

Table of Contents