54
Chapter 4: The Design Notes API
Example
The following code might be used in a custom floating panel to display the Design Notes
information for the active document:
var noteHandle = MMNotes.open(dw.getDocumentDOM().URL);
var theKeys = MMNotes.getKeys(noteHandle);
var noteString = "";
var theValue = "";
for (var i=0; i < theKeys.length; i++){
theValue = MMNotes.get(noteHandle,theKeys[i]);
note= theKeys[i] + " = " th "\n";
}
document.theForm.bigTextField.value = noteString;
// always close noteHandle
MMNotes.close(noteHandle);
MMNotes.getSiteRootForFile()
Description
This function determines the site root for the specified Design Notes file.
Arguments
fileURL
•
The
fileURL
argument, which is expressed as a file:// URL, is the path to a local file.
Returns
A string that contains the path of the Local Root folder for the site, which is expressed as a file://
URL, or an empty string if Dreamweaver is not installed or the Design Notes file is outside any
site that is defined with Dreamweaver. This function searches for all the sites that are defined in
Dreamweaver.
MMNotes.getVersionName()
Description
This function gets the version name of the MMNotes shared library, which indicates the
application that implemented it.
Arguments
None.
Returns
A string that contains the name of the application that implemented the MMNotes shared
library.
Example
Calling the
MMNotes.getVersionName()
function from a Dreamweaver command, object,
behavior, Property inspector, floating panel, or data translator returns
"Dreamweaver"
. Calling
the
MMNotes.getVersionName()
function from Fireworks also returns
"Dreamweaver"
because
Fireworks uses the same version of the library, which was created by the Dreamweaver
engineering team.
000_DW_API_Print.book Page 54 Wednesday, August 20, 2003 9:14 AM
Summary of Contents for DREAMWEAVER MX 2004-DREAMWEAVER API
Page 1: ...Dreamweaver API Reference...
Page 24: ...24 Contents...
Page 32: ......
Page 70: ...70 Chapter 5 Fireworks Integration...
Page 76: ...76 Chapter 6 Flash Integration...
Page 116: ...116 Chapter 9 The JavaBeans API...
Page 140: ......
Page 152: ...152 Chapter 11 Application...
Page 218: ...218 Chapter 12 Workspace...
Page 248: ...248 Chapter 13 Site...
Page 292: ...292 Chapter 14 Document...
Page 378: ...378 Chapter 17 Design...
Page 430: ...430 Chapter 18 Code...
Page 486: ...486 Index...