Browse the docs

clipboard

The text currently on the clipboard.

Keyboard Maestro: SystemClipboard, CurrentClipboard

Details #

Use it anywhere a {{ }} expression is allowed, as {{clipboard}} in a step's text or as clipboard inside a longer expression. It also works as a call, clipboard(). It reads the clipboard at the moment the expression is evaluated and gives its plain text. When the clipboard holds no text (an image, say), the result is an empty string.

{{clipboard.rich}} is the same clipboard as HTML when it holds rich text (a web page, a formatted document; RTF is converted), and the plain text otherwise. Paste as uses it to turn rich text into Markdown.

A run variable with the same name wins. If a step stores something in a variable called clipboard, {{clipboard}} reads that variable, not the live value. Name your own variables something else.

Parameters #

Write it as {{clipboard}} in any text field. A variable of the same name wins.

Examples #

upper(clipboard)
→ HELLO THERE
Sample variableValue
clipboardhello there
length(clipboard) > 0 ? "has text" : "empty"
→ has text
Sample variableValue
clipboardhttps://example.com
Show the clipboard
When
  1. Press ⌃⌥J
Do
  1. Show “Clipboard: {{clipboard}}”
Open in Switchboard to try it

Gotchas #

  • The sample variables in a playground replace the token, as they would in a run. Remove the vars: line to read your real clipboard.

See also #