240
ActiveScripting examples
JScript
<html>
<head>
<title>JScript Example</title>
</head>
<body>
<pre>
//
//=====================================================================
// ActiveScripting example (JScript)
//=====================================================================
// Displays a table containing the filenames of all open documents,
// whether or not each document has been modified, and whether each
// document is read-only.
//=====================================================================
function Main() {
var newline = ‘\n’;
var br = ‘<br>’;
var tab = ‘\t’;
// 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’)
var app = Application;
// save the index of the current document so it can be returned to
var nCurrentIdx = app.DocumentIndex;
// start the table
var 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; idx < app.DocumentCount; idx++) {
// get document name (uses function example)
fname = GetDisplayName(app.DocumentCache(idx).Filename);
sTable = tab + ‘<tr><td>’ + fname;
sTable = ‘</td><td>’;
Содержание COLDFUSION STUDIO 4.5-USING COLDFUSION...
Страница 1: ...Allaire Corporation Using ColdFusion Studio ColdFusion Studio 4 5 for Windows 95 98 NT4 2000...
Страница 16: ...xvi Contacting Allaire...
Страница 90: ...82...
Страница 130: ...122...
Страница 133: ...141 Two VTML tags CAT and E let you customize the content of these dialog boxes...
Страница 182: ...190...