276
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 = sTable + 'Names and properties of all open documents:';
sTable = sTable + '</FONT></B><br><br><br>';
sTable = sTable + '<TABLE border="1" width="500">' + newline;
sTable = sTable + newline + '<TR><TD><B>Document Name</B></TD>';
sTable = sTable + '<TD><B><CENTER>Modified</CENTER></B></TD>';
sTable = sTable + '<TD><B><CENTER>Read-Only</CENTER></B></TD>';
sTable = 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 = sTable + tab + '<tr><td>' + ExtractFileName(fname);
sTable = sTable + '</td><td>';
Chapter 14 Scripting the Visual Tools Object Model
Need help?
Do you have a question about the COLDFUSION STUDIO 5-USING COLDFUSION 5 STUDIO and is the answer not in the manual?