Clipboard functions are related to cutting, copying, and pasting. On the Macintosh, some Clipboard functions can also apply to text fields in dialog boxes and floating panels. Functions that can operate in text fields are implemented as methods of the dreamweaver object and as methods of the DOM object. The dreamweaver version of the function operates on the selection in the active window: the current Document window, the Code inspector, or the Site panel. On the Macintosh, the function can also operate on the selection in a text box if it is the current field. The DOM version of the function always operates on the selection in the specified document.

dom.clipCopy()

Availability

Dreamweaver 3.

Description

Copies the selection, including any HTML markup that defines the selection, to the Clipboard.

Arguments

None.

Returns

Nothing.

dom.clipCopyText()

Availability

Dreamweaver 3.

Description

Copies the selected text to the Clipboard, ignoring any HTML markup.

Arguments

None.

Returns

Nothing.

Enabler

dom.clipCut()

Availability

Dreamweaver 3.

Description

Removes the selection, including any HTML markup that defines the selection, to the Clipboard.

Arguments

None.

Returns

Nothing.

dom.clipPaste()

Availability

Dreamweaver 3.

Description

Pastes the contents of the Clipboard into the current document at the current insertion point or in place of the current selection. If the Clipboard contains HTML, it is interpreted as such.

Arguments

None.

Returns

Nothing.

Enabler

Example

If the Clipboard contains ABC Widgets, a call to dw.getDocumentDOM().clipPaste() results in the following figure:

Clipboard with ABC Widgets

dreamweaver.clipCopy()

Availability

Dreamweaver 3.

Description

Copies the current selection from the active Document window, dialog box, floating panel, or Site panel to the Clipboard.

Arguments

None.

Returns

Nothing.

Enabler

dreamweaver.clipCut()

Availability

Dreamweaver 3.

Description

Removes the selection from the active Document window, dialog box, floating panel, or Site panel to the Clipboard.

Arguments

None.

Returns

Nothing.

Enabler

dreamweaver.clipPaste()

Availability

Dreamweaver 3. Added the strPasteOption argument in Dreamweaver 8.

Description

Pastes the contents of the Clipboard into the current document, dialog box, floating panel, or Site panel.

Arguments

{strPasteOption}

  • The strPasteOption argument, which is optional, specifies the type of paste to perform. Values include: "text", "structured", "basicFormat", and "fullFormat".

Returns

Nothing.

Enabler

Example

The following example pasts the contents of the Clipboard as text:

 dw.clipPaste("text");

dreamweaver.getClipboardText()

Availability

Dreamweaver 3.

Description

Gets all the text that is stored on the Clipboard.

Arguments

{bAsText}

  • The bAsText Boolean value, which is optional, specifies whether the Clipboard content is retrieved as text. If bAsText is a value of true, the Clipboard content is retrieved as text. If bAsText is a value of false, the content retains formatting. This argument defaults to false.

Returns

A string that contains the contents of the Clipboard, if the Clipboard contains text (which can be HTML); otherwise, it returns nothing.

Example

If dreamweaver.getClipboardText() returns "text <b>bold</b> text", dreamweaver.getClipboardText(true) returns "text bold text".

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy