Edit in GitHubLog an issue

Clipboard

Read and write content from and to the clipboard.

System requirements

Please make sure your local environment uses the following application versions before proceeding.

  • InDesign v18.5 or higher
  • UXP version v7.1 or higher
  • Manifest version v5 or higher

Example

Copied to your clipboard
async function foo() {
const clipboard = navigator.clipboard;
// Setting content for clipboard
clipboard.setContent({ 'text/plain': "Test string to validate clipboard setContent" })
.then(() => {
console.log("Data successfully set on clipboard");
}, (error) => {
console.error("Error while setting data on clipboard:", error);
});
// Reading from clipboard and printing
clipboard.getContent()
.then((result) => {
console.log(`Data from clipboard: ${result["text/plain"]}`);
}, (error) => {
console.error("Error while reading data from clipboard:", error);
});
}

Additional notes

  • Set the permission to "read" if your script/plugin only intends to read from the clipboard.

Reference material

  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.