246
Chapter 15 Scripting the Visual Tools Object Model
When using this method in JScript, you must escape backslashes inside a string. For
example, in
Application.OpenFile("C:\\Documents\\MyFile.htm")
; each
backslash is preceded by an additional backlash.
Example
function Main() {
Var sFile;
Var bResult;
sFile = "C:\\Temp\myDoc.txt"
with (Application) {
If(OpenFile(sFile))
MessageBox("File opened successfuly.", VersionText);
Else
MessageBox("File does not exist or already open.", VersionText);
}
}
PreviousDoc
Syntax
PreviousDoc();
Description
Moves to the previous document in the Document tab. If the first document is
showing, wraps to the last.
Example
function Main(){
with (Application){
// Create a new blank document
NewDocument(false);
// Move back to previous file
PreviousDoc();
}
}
Quit
Syntax
Quit();
Description
Attempts to exit from or quit the program. Prompts the user to save any unsaved
documents prior to quitting.
Example
function Main(){
var MB_YESNO = 4;
var IDYES = 6;
with (Application){
if (MessageBox('Exit HomeSite?', 'Confirmation Message',
MB_YESNO) == 6){
Quit();
}
}
}
Summary of Contents for HOMESITE
Page 11: ...Contents xi Table of CommandID values 310 Table of SettingID values 314 Glossary 323...
Page 12: ...xii Contents...
Page 20: ...xx About This Book...
Page 28: ...8 Chapter 1 Setting Up the Product...
Page 70: ...50 Chapter 4 Managing Files...
Page 88: ...68 Chapter 5 Writing Code and Web Content...
Page 116: ...96 Chapter 6 Editing Pages...
Page 148: ...128 Chapter 7 Using Web Development Languages...
Page 190: ...170 Chapter 11 Deploying Files...
Page 210: ...190 Chapter 12 Testing and Maintaining Web Pages...
Page 216: ...196 Chapter 13 Extending the Help System...
Page 350: ...330 Glossary...
Page 358: ...338 Index...