copy Action

An action to copy data to the macOS clipboard.

{
  "copy": {
    "type": "file",
    "src": [
      "~/Desktop/dinner-plans.txt",
      "~/Desktop/favourite-cheeses.txt"
    ]
  }
}

Properties

type
ENUM
Default: "text"

The type of data to be copied to the clipboard using the src property.

Value Description
"text" Copy the src to the clipboard as plain text
"file" Copy the src to the clipboard as a File reference
"url" Copy the src to the clipboard as a URL
src
STRING | ARRAY
Required

The data to be copied to the clipboard.

Tip

Use an ARRAY to pass multiple file paths.

Examples

Copy a URL to the clipboard

{
  "type": "button",
  "text": "Copy URL to the Alfred homepage",
  "events": [
    {
      "triggers": "actioned",
      "action": {
        "type": "json",
        "src": {
          "copy": {
            "type": "url",
            "src": "https://www.alfredapp.com"
          }
        }
      }
    }
  ]
}