276
Chapter 14 Scripting the Visual Tools Object Model
ActiveScripting Examples
JScript
<html>
<head>
<title>JScript Example</title>
</head>
<body>
<pre>
//*****************************************************//
// ActiveScripting example (JScript)
//*****************************************************//
// Generates a table of the filenames of all open documents,
// listing their modified status and read-only property.
//****************************************************//
function Main (){
var newline;
var br;
var tab;
var sTable;
var count;
newline = ’\n’;
br = ’<BR>’;
tab = ’\t’;
with (Application){
// start the table
sTable = ’<B><FONT size="+1" color="Blue">’;
sTable = ’Names and properties of all open documents:’;
sTable = ’</FONT></B><br><br><br>’;
sTable = ’<TABLE border="1" width="500">’ + newline;
sTable = n ’<TR><TD><B>Document Name</B></TD>’;
sTable = ’<TD><B><CENTER>Modified</CENTER></B></TD>’;
sTable = ’<TD><B><CENTER>Read-Only</CENTER></B></TD>’;
sTable = ’</TR>’ + newline;
count = 0;
// loop through all open documents and put their
// names and properties into the table.
while (count <= (DocumentCount - 1)){
// get document’s name
fname = GetDisplayName(DocumentCache(count).FileName);
//extracting the document’s name only without its path
sTable = tab + ’<tr><td>’ + ExtractFileName(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...