Discussion

1
Replies
1487
Views
navaj Member since 2016 1 post
PEGA
Posted: 3 years ago
Last activity: 3 years 8 months ago

How to Copy Text to Clipboard from Automations

Below are the steps to copy information to the user's clipboard from an automation.

1) Add a Script component to the project's global container

2) Add the following to using / imports section

using System.Threading;

3) Add a new Script

Name:CopyTextToClipboard

Parameters: string text

Result type: void

Method body:

Thread thread = new Thread(() => System.Windows.Forms.Clipboard.SetText(text));

thread.SetApartmentState(ApartmentState.STA); //Set the thread to STA

thread.Start();

thread.Join();

***Updated by Moderator: Marissa to change from a Question post to a Discussion; added FAQ group tag***

Robotic Process Automation Developer Knowledge Share
Share this page LinkedIn