278
Chapter 14 Scripting the Visual Tools Object Model
VBScript
<html>
<head>
<title>VBScript Example</title>
</head>
<body>
<pre>
//********************************************************//
// Displays a table containing file information
//********************************************************//
Sub Main
dim app
dim idx
dim sTable
dim newline, fname, br, tab
dim nCurrentIdx
newline = chr(13) + chr(10)
br = "<br>"
tab = chr(9)
‘ create app reference. note that the Application object is only
‘ available from within HomeSite and Studio - to create the app
object from an
‘ external script, use
CreateObject("AllaireClientApp.TAllaireClientApp")
set app = Application
‘ save the index of the current document so it can be returned to
nCurrentIdx = app.DocumentIndex
‘ start the table
sTable = "<b><font color=Blue>Names of all open"_
+ " documents:</font></b>"_
+ br + n br + newline _
+ "<table border=1 width=460>"_
+ n "<tr>"_
+ "<td><b>Document</b></td>"_
+ "<td><b>Modified</b></td>"_
+ "<td><b>Read-Only</b></td>"_
+ "</tr>" + newline
‘ loop through all open documents (note that DocumentCount is
1-based,
‘ whereas DocumentCache() is 0-based)
for idx = 0 to app.DocumentCount - 1
‘ get document name (uses function example)
fname = GetDisplayName(app.DocumentCache(idx).Filename)
sTable = tab + "<tr><td>" + fname
sTable = "</td><td>"
Содержание 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...