Applies to TestComplete 14.10, last modified on June 5, 2019

Description

Use this property to put text or images to the clipboard or to retrieve the data kept in the clipboard.

Declaration

Sys.Clipboard

Read-Write Property Variant

Applies To

The property is applied to the following object:

Sys

Property Value

A Variant value that provides access to the Clipboard contents. If the clipboard holds an image, the property returns a Picture object corresponding to this image.

Example

The following code demonstrates how to put images and text to and get data from the clipboard.

JavaScript, JScript

// Storing and getting an image
Sys.Clipboard = Sys.Process("notepad").Window("Notepad", "* - Notepad").Picture();
Log.Picture(Sys.Clipboard);
 
// Storing and getting text
Sys.Clipboard = Sys.Process("notepad").Window("Notepad", "* - Notepad").WndCaption;
Log.Message(Sys.Clipboard);

Python

# Storing and getting an image
Sys.Clipboard = Sys.Process("notepad").Window("Notepad", "* - Notepad").Picture()
Log.Picture(Sys.Clipboard)

# Storing and getting text
Sys.Clipboard = Sys.Process("notepad").Window("Notepad", "* - Notepad").WndCaption
Log.Message(Sys.Clipboard)

VBScript

' Storing and getting an image
Set Sys.Clipboard = Sys.Process("notepad").Window("Notepad", "* - Notepad").Picture
Log.Picture(Sys.Clipboard)
 
' Storing and getting text
Sys.Clipboard = Sys.Process("notepad").Window("Notepad", "* - Notepad").WndCaption
Log.Message(Sys.Clipboard)

DelphiScript

// Storing and getting an image
Sys.Clipboard := Sys.Process('notepad').Window('Notepad', '* - Notepad').Picture;
Log.Picture(Sys.Clipboard);
 
// Storing and getting text
Sys.Clipboard := Sys.Process('notepad').Window('Notepad', '* - Notepad').WndCaption;
Log.Message(Sys.Clipboard);

C++Script, C#Script

// Storing and getting an image
Sys["Clipboard"] = Sys["Process"]("notepad")["Window"]("Notepad", "* - Notepad")["Picture"]();
Log["Picture"](Sys["Clipboard"]);
 
// Storing and getting text
Sys["Clipboard"] = Sys["Process"]("notepad")["Window"]("Notepad", "* - Notepad")["WndCaption"];
Log["Message"](Sys["Clipboard"]);

See Also

About Clipboard Checkpoints

Highlight search results