Advanced

Shortcuts app

PasteDaemon's actions in Apple's Shortcuts app — read what you copied, put text on the clipboard, pause recording and run PasteDaemon's actions on text, inside shortcuts of your own.

PasteDaemon puts seven actions in the Shortcuts app, so a shortcut you build can read what you copied, put text on the clipboard, pause recording and run one of PasteDaemon's actions on text in the middle of something else. That last one is the reason to want it: slug, json, extract-urls or one of your own pipelines becomes a step in a shortcut, beside whatever else the shortcut does.

Not to be confused with the Shortcuts pane in Preferences, which is the keyboard chords the overlay answers to. This page is about Apple's app.

Setting it up

Switch Allow the Shortcuts app to use PasteDaemon on in the Advanced pane. That is the whole of it: there is no key to paste anywhere, and the API server does not have to be running.

The actions are listed in the Shortcuts app either way — search for PasteDaemon in the action list. With the switch off, a shortcut that uses one stops at that step and says where to turn it on, rather than carrying on as if it had worked, and the list of actions or variables beside a field shows that same sentence instead of your actions or variables.

It is a switch of its own rather than the API's. Turning the API off has always meant that nothing over HTTP can reach your clipboard, and a shortcut needs no server listening — so one switch answering for both would have quietly made that promise smaller. It belongs to the Mac it is set on, and does not sync.

The actions

ActionWhat it does
Get Newest Clipboard ItemThe newest item in the history, as text. A picture gives the words read out of it; copied files give their paths
Search Clipboard HistoryWhat you copied, the one used last first, as a list of text — by what it says, by tag, by when it was first copied — on, since or before a date — pinned only, up to a limit — and Sorted By any of the overlay's orders: most pasted, oldest first, largest. With nothing to search for, the most recent items
Put Text on the ClipboardText on the clipboard, kept in the history unless told not to. Written as Markdown, HTML or RTF it goes on as formatted text. The HUD says so
Get VariableOne of your variables, as text. A list gives one item per line, and a picture the words read in it
Set VariableGives a variable a value, making it if there is none. What it held before stays in its history
Pause or Resume RecordingStops keeping what is copied, starts again, or toggles. Gives back whether it is recording now. Pausing clears the history too when Clear history when recording is paused is on in Copy/Paste
Run PasteDaemon ActionRuns one of the actions — the standard library's or yours — on text, and gives back what it made. Without text, it runs on the newest clipboard item

Four of them — getting the clipboard, searching, running an action and pausing — are also offered without being put in a shortcut first, in Spotlight and to Siri: "Get my clipboard from PasteDaemon", "Search PasteDaemon", "Run a PasteDaemon action", "Pause PasteDaemon".

What is changed through the Shortcuts app is recorded as coming from Shortcuts, the way a trigger's rewrite names its trigger, so a value in a variable's history says where it came from.

What it will not do

The limits are the API's, kept by the same code:

  • No secret is read or written. Opening one needs Touch ID or your password, and a shortcut may be running with nobody at the Mac. A sealed clipboard item is refused rather than handed on as ••••••••.
  • Only the scripts PasteDaemon ships run. An action that is a script of your own is refused at the step, by name — put the script in a Run Shell Script step instead, where the Shortcuts app shows you what it runs. The action picker leaves those out to begin with.
  • Running an action changes nothing. A pipeline action that would also write a variable or tag an entry hands back its result and leaves that undone. Set Variable and Put Text on the Clipboard are the actions that write.
  • No trigger fires on text a shortcut puts on the clipboard.

A licence

Like the API, the Shortcuts app is part of what a licence covers. A shortcut run without one stops at the step and says so; the history and search stay free in PasteDaemon itself.

If PasteDaemon is missing from the list

The Shortcuts app finds the actions through the copy of PasteDaemon macOS has on record for its name. Usually there is one copy, in Applications, and nothing to do. If you have kept an older copy somewhere else — a second download, a backup — macOS may be looking at that one: delete the spare and open PasteDaemon again.