Sys.Clipboard Property

Applies to TestComplete 15.69, last modified on November 13, 2024

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

Clipboard Checkpoints

Highlight search results