Clipboard Object
From SecureCRT
Description
The Clipboard object provides access to the application's clipboard.
Syntax
crt.Clipboard.Property [ = expression ]
Clipboard Object Properties
Description
Returns or sets the clipboard format.
Remarks
Possible formats are: CF_TEXT, CF_OEMTEXT, CF_UNICODETEXT, and VDS_TEXT.
The following command restores the value to the global format for the clipboard:
crt.Clipboard.Format = crt.Clipboard.DEFAULTFORMAT
Example:
#$language = "VBScript"
#$interface = "1.0"
crt.Screen.Synchronous = True
Sub Main
' Get the current clipboard format
format = crt.ClipboardFormat
' Set the clipboard format to VDS_TEXT:
crt.Clipboard.Format = crt.Clipboard.CF_VDS_TEXT
' Restore the original clipboard format
crt.Clipboard.Format = format
End Sub
Description
Read-only property that returns the format string for CF_OEMTEXT clipboard format. This text format contains characters in the OEM character set. Each line ends with a carriage return/linefeed (CR-LF) combination. A null character signals the end of the data.
Syntax
var = crt.clipboard.CF_OEMTEXT
Description
Read-only property that returns the format string for CF_TEXT clipboard format. In this text format, each line ends with a carriage return/linefeed (CR-LF) combination. A null character signals the end of the data. Use this format for ANSI text.
Syntax
var = crt.clipboard.CF_TEXT
Description
Read-only property that returns the format string for CF_UNICODETEXT clipboard format. For Windows NT/2000/XP: In Unicode text format, each line ends with a carriage return/linefeed (CR-LF) combination. A null character signals the end of the data.
Syntax
var = crt.clipboard.CF_UNICODETEXT
Description
Read-only Property that returns the format string for DEFAULTFORMAT clipboard format. Setting the format to this property restores the value to the global default format for the clipboard.
Syntax
var = crt.clipboard.DEFAULTFORMAT
Description
Read-only property that returns the format string for VDS_TEXT clipboard format. This is a private clipboard format that translates certain special characters to ASCII when copying data from the screen to the clipboard. The characters that are translated are as follows:
· directional quotation marks (also known as "smart quotes") are changed to ASCII quotation marks
· "em" dashes are changed to hyphens
· "en" dashes are changed to hyphens
Syntax
var = crt.clipboard.VDS_TEXT
Description
Returns or sets the contents of the clipboard.
Syntax
crt.clipboard = varname
[ varname = ] crt.clipboard
Remarks
Example:
# $language = "VBScript"
# $interface = "1.0"
' Put the selected text into the clipboard:
crt.Clipboard.Text = crt.Screen.Selection
' Transfer text from the clipboard into a variable for
' use within the script:
MyStr = crt.Clipboard.Text
' Send the contents of the clipboard to the remote
' machine:
crt.Screen.Send crt.Clipboard.Text