228
Chapter 14 Scripting the Visual Tools Object Model
Sample toolbar script 1
//******************************************************//
// This script creates a toolbar named Apps if one does not exist,
// then adds two custom toolbuttons to it. The first toolbutton
// launches Windows Explorer, the second one opens Windows Explorer
// at the current folder in the editor.
//****************************************************//
function Main() {
var TB_NAME = ‘Apps’;
var app = Application;
if (!app.ToolbarExists(TB_NAME)) {
app.CreateToolbar(TB_NAME);
}
app.AddAppToolbutton(TB_NAME, ‘c:\\windows\\explorer.exe’, ",
‘Explorer’);
app.AddAppToolbutton(TB_NAME, ‘c:\\windows\\explorer.exe’,
app.CurrentFolder, ’Explorer - Current Folder’);
Here’s the same code in VBScript:
Sub Main
const TB_NAME = "Apps"
Dim app
set app = Application
if not app.ToolbarExists(TB_NAME) then
app.CreateToolbar TB_NAME
end if
app.AddAppToolbutton TB_NAME, "c:\windows\explorer.exe", "",
"Explorer"
app.AddAppToolbutton TB_NAME, "c:\windows\explorer.exe",
app.CurrentFolder, "Explorer - Current Folder"
End Sub
Содержание ColdFusion Server 5
Страница 18: ...xviii About This Book...
Страница 26: ...8 Chapter 1 Setting Up the Product...
Страница 42: ...24 Chapter 2 Configuring Browsers and Servers...
Страница 60: ...42 Chapter 3 Exploring the Workspace...
Страница 100: ...82 Chapter 6 Editing Pages...
Страница 126: ...108 Chapter 7 Using Web Development Languages...
Страница 212: ...194 Chapter 13 Customizing the Development Environment...
Страница 320: ...302 Glossary...