Specifications
Chapter 31392
Returns
A string that contains the contents of the Clipboard, if the Clipboard contains text (which can be
HTML); otherwise, nothing.
Example
If dreamweaver.getClipboardText() returns "text <b>bold</b> text", then
dreamweaver.getClipboardText(true) returns "text bold text".
Code hints functions
Code Hints are menus that Macromedia Dreamweaver MX pops up when you type certain
character patterns in the Code view. Code Hints offer a typing shortcut by providing a list of
strings that potentially complete the string you are typing. If the string you are typing appears in
the menu, you can scroll to it and press Enter or Return to complete your entry. For example,
when you type
<, a pop-up menu shows a list of tag names. Instead of typing the rest of the tag
name, you can select the tag from the menu to include it in your text.
Dreamweaver loads Code Hints menus from the CodeHints.xml file in the Configuration folder.
You can add Code Hints menus to Dreamweaver MX by defining them in the CodeHints.xml
file. After Dreamweaver MX loads the contents of CodeHints.xml, you can also add new Code
Hints menus dynamically through JavaScript. For example, JavaScript code populates the list of
session variables in the Bindings panel. You can use the same code to add a Code Hints menu, so
when a user types “
Session.” in Code view, Dreamweaver MX displays a menu of session
variables. For information on using JavaScript to add or modify a Code Hints menu, see “Code
hints functions” on page 397.
Dreamweaver cannot express some types of Code Hints menus through the XML file or the
JavaScript API. Both the CodeHints.xml file and the JavaScript API expose a useful subset of the
Code Hints engine, but some Dreamweaver functionality is not accessible. For example, there is
no JavaScript hook to pop up a color picker, so Dreamweaver cannot express the Attribute Values
menu using JavaScript. You can only pop up a menu of text items from which you can insert text.
Also, when you insert text, the insertion pointer is placed after the inserted string.
The CodeHints.xml file
The CodeHints.xml file contains the following entities:
• A list of all the menu groups
Dreamweaver displays the list of menu groups when you select the Code Hints category from
the Preferences dialog box. You can activate the Preferences dialog box by selecting Preferences
from the Edit menu. Dreamweaver MX provides the following menu groups or types of Code
Hints menus: Tag Names, Attribute Names, Attribute Values, Function Arguments, Object
Methods and Variables, and HTML Entities.
• The description for each menu group
The description appears in the Preferences dialog box for the Code Hints category when you
select the menu group in the list. The description for the selected entry appears below the
menu group list.
• Code Hints menus
A menu consists of a pattern that triggers the Code Hints menu, and a list of menu items. For
example, a pattern such as "
&" could trigger a menu such as "&", ">", "<".