252
Chapter 15 Scripting the Visual Tools Object Model
Wait
Syntax
Wait(nMilliseconds: Integer);
Description
Pauses for given number of milliseconds. Use Wait to enable scripts to execute loops,
yet still allow access to the UI. Without the call to Wait in the loop, the application
appears locked and the user cannot change views.
Example
The following JScript sample waits for the user to return to edit source view:
var app = Application;
while (app.CurrentView != 1) {
app.Wait(100);
}
This is the same sample code in VBScript:
set app = Application
while app.CurrentView 1
app.Wait (100)
wend
Toolbar and toolbutton methods
This section describes the toolbar manipulation methods available in the
Application object.
A unique name identifies each toolbar. The name of the toolbar displays in the title
bar caption when the toolbar is not docked. Toolbars are loaded from files in the
toolbar directory, which can be obtained from the
ToolbarDir
property. The toolbar
name is the same as its filename without the path or extension. For example, if the
toolbar filename is Custom.tbr, then the toolbar name is Custom.
When you create a toolbutton, remember that a toolbutton label is limited to two
characters.
AddAppToolbutton
Syntax
AddAppToolbutton(wsToolbarName, wsExeFile, wsCmdLine, wsHint: Wide-
String): WordBool;
Description
Boolean. Adds a toolbutton for an external application to the passed toolbar. Fails if
the toolbar does not exist or if the toolbutton could not be added. Returns
True
if the
same toolbutton (based on
wsExeFile
and
wsCmdLine
) already exists on the toolbar,
but does not add a duplicate toolbutton.
Example
function Main(){
with (Application){
AddAppToolbutton('Standard', 'Notepad.exe', '', 'NotePad');
}
}
Содержание HOMESITE
Страница 11: ...Contents xi Table of CommandID values 310 Table of SettingID values 314 Glossary 323...
Страница 12: ...xii Contents...
Страница 20: ...xx About This Book...
Страница 28: ...8 Chapter 1 Setting Up the Product...
Страница 70: ...50 Chapter 4 Managing Files...
Страница 88: ...68 Chapter 5 Writing Code and Web Content...
Страница 116: ...96 Chapter 6 Editing Pages...
Страница 148: ...128 Chapter 7 Using Web Development Languages...
Страница 190: ...170 Chapter 11 Deploying Files...
Страница 210: ...190 Chapter 12 Testing and Maintaining Web Pages...
Страница 216: ...196 Chapter 13 Extending the Help System...
Страница 350: ...330 Glossary...
Страница 358: ...338 Index...