> For the complete documentation index, see [llms.txt](https://docs.gpmautomate.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gpmautomate.com/automate-en/action-guide/clipboard/set-clipboard-text.md).

# Set clipboard text

Set clipboard text is an action used to assign (write) a string of text or the value of a variable to the operating system's clipboard. This action is equivalent to highlighting text and pressing the Copy shortcut (`Ctrl + C`) on the computer.

This action is often used as a buffer before you use the paste command, helping to quickly input long text passages or special characters into the browser without the risk of typing errors.

🎥 Watch the tutorial video: [Here](https://youtu.be/OLHoUtANkXw).

#### Configuration parameters:

* Text: The raw text content (or variable containing data) that you want to load into the clipboard.

> ⚠️ Extremely important note regarding Multi-threading: Similar to the action of getting text, Set clipboard text is not suitable for multi-threaded execution. Since the Windows operating system uses a single shared clipboard for the entire system, having multiple profiles write data to the clipboard simultaneously will cause contention, with the later thread overwriting the data of the earlier thread and leading to incorrect results. It is advisable to use this action for single-threaded scenarios.

#### Practical example: Automatically copy and paste long article content

When you need to fill in a very long text (such as a complexly formatted sales article) into an input field on a website. If you use the regular typing action, the system will take a long time to type each character and sometimes encounter Vietnamese font errors. The optimal method is to use the Clipboard:

* Step 1: You call the Set clipboard text action, filling in the article content in the Text field (or passing the data variable `$postContent`).
* Step 2: You click on the input field on the website, then call the Key press action with the key combination `Control+V` to paste the entire text passage into the website immediately.

Result: The entire content of the long article will be pasted into the website in an instant, ensuring the format is preserved, no typing errors occur, and the script execution speed is maximized.

<figure><img src="https://2961903581-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpIRrmOLZkhHBXdAiidIw%2Fuploads%2Fgit-blob-dd5e1c628f36e30ab719ec301325f7c528aa49fc%2Fcl-02.png?alt=media" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.gpmautomate.com/automate-en/action-guide/clipboard/set-clipboard-text.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
