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
Summary of Contents for ColdFusion Server 5
Page 18: ...xviii About This Book...
Page 26: ...8 Chapter 1 Setting Up the Product...
Page 42: ...24 Chapter 2 Configuring Browsers and Servers...
Page 60: ...42 Chapter 3 Exploring the Workspace...
Page 100: ...82 Chapter 6 Editing Pages...
Page 126: ...108 Chapter 7 Using Web Development Languages...
Page 212: ...194 Chapter 13 Customizing the Development Environment...
Page 320: ...302 Glossary...