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 on Windows are: CF_TEXT, CF_OEMTEXT, CF_UNICODETEXT, and VDS_TEXT.
Possible formats on Mac are: CF_UNICODETEXT and VDS_TEXT.
The following command restores the value to the global format for the clipboard:
crt.Clipboard.Format = crt.Clipboard.DEFAULTFORMAT
VBScript
Example
#$language = "VBScript"
#$interface = "1.0"
crt.Screen.Synchronous = True
Sub Main
' Get the current clipboard format
format = crt.Clipboard.Format
' Set the clipboard format to VDS_TEXT:
crt.Clipboard.Format = crt.Clipboard.VDS_TEXT
' Restore the original clipboard format
crt.Clipboard.Format = format
End Sub
Python
Example
#$language = "Python"
#$interface = "1.0"
crt.Screen.Synchronous = True
def main():
# Get the current clipboard format
format = crt.Clipboard.Format
# Set the clipboard format to VDS_TEXT:
crt.Clipboard.Format = crt.Clipboard.VDS_TEXT
# Restore the original clipboard format
crt.Clipboard.Format = format
main()
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.
Note
This format is only supported on Windows.
VBScript
Syntax
var = crt.clipboard.CF_OEMTEXT
Python
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.
Note
This format is only supported on Windows.
VBScript
Syntax
var = crt.clipboard.CF_TEXT
Python
Syntax
var = crt.clipboard.CF_TEXT
Description
Read-only property that returns the format string for CF_UNICODETEXT clipboard format. For Windows: In Unicode text format, each line ends with a carriage return/linefeed (CR-LF) combination. A null character signals the end of the data.
VBScript
Syntax
var = crt.clipboard.CF_UNICODETEXT
Python
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.
VBScript
Syntax
var = crt.clipboard.DEFAULTFORMAT
Python
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
VBScript
Syntax
var = crt.clipboard.VDS_TEXT
Python
Syntax
var = crt.clipboard.VDS_TEXT
Description
Returns or sets the contents of the clipboard.
VBScript
Syntax
crt.clipboard = varname
[ varname = ] crt.clipboard
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
Python
Syntax
crt.clipboard = varname
[ varname = ] crt.clipboard
Example
#$language = "Python"
#$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)