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 variable | Value |
|---|---|
clipboard | hello there |
length(clipboard) > 0 ? "has text" : "empty"has text| Sample variable | Value |
|---|---|
clipboard | https://example.com |
- Press ⌃⌥J
- Show “Clipboard: {{clipboard}}”
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.