Automation

Stop Cleaning Links by Hand: Clipboard Rules on macOS

Tracking parameters, screenshots piling up, the same phone number retyped from a signature. Clipboard rules handle all three at copy time, on your Mac.

Open your last ten shared links. Count how many carry a tail like this:

https://example.com/article?utm_source=newsletter&utm_medium=email&utm_campaign=sept&fbclid=IwAR2x

You did not add that. A newsletter did, or a share sheet did. And every time you paste that link into a doc, a ticket or a message, the tail goes with it.

Most people clean it by hand. Select from the question mark to the end, delete, hope you did not cut a real parameter like ?page=2. Ten seconds each time, several times a day, for years.

That is the kind of work a rule should do instead.


1. What a clipboard rule is

A rule has two halves: what it matches and what it does. It runs the moment a copy lands, before you paste, and before the clip settles into history.

Match on:

  • the app you copied from (Safari, Slack, Xcode, Preview)
  • the type of clip (link, image, code, plain text)
  • its length (anything over 2,000 characters, say)
  • its text, with search syntax: a | b for either, -word to exclude, "exact phrase" for exact matches

Then act:

  • clean tracking parameters off a link
  • run a transform (case, JSON pretty print, base64, trim)
  • extract just the email address or the number from what you copied
  • compress a copied image
  • pin it, or burn it after one paste
  • file it under a label or a collection

Nothing is active until you add a rule. That matters: a tool that starts rewriting your copies on install is a tool you cannot trust with a password.


2. Five rules worth having on day one

Match: clip type is a link. Action: clean tracking parameters.

This one pays for itself the first afternoon. Copy from a newsletter, paste into your notes, and the URL is already bare.

File every screenshot

Match: clip type is an image, source app is Screenshot. Action: file under a Screenshots collection.

Screenshots are the main reason recent history becomes unreadable. Take five in a row while debugging and everything you copied this morning is pushed off the first screen. Filing them keeps them without letting them crowd out text.

Extract the email

Match: text contains @ and is longer than 120 characters. Action: extract the email address.

Copy a whole signature block from an email, paste a clean address into the CRM field. No selecting inside a signature, which never selects cleanly.

Compress big images

Match: clip type is an image over some size. Action: compress.

Pasting a 12 MB screenshot into a ticket is slow for you and slow for everyone who opens it afterwards.

Burn one-time codes

Match: text matches a six digit number from your bank or auth app. Action: burn after paste.

The code is useful for thirty seconds and then it is clutter with a security smell. Let it delete itself.


3. Rules against transforms against snippets

These three get mixed up, so here is the split:

When it runs You do Good for
Rule Automatically, at copy time Nothing Work that repeats every day
Transform On demand, on a clip you pick Pick the clip, pick the action One-off conversions
Snippet When you call it by keyword Type the keyword Text you send often

A rule is for the thing you would otherwise do a hundred times without thinking. A transform is for the thing you do when you notice you need it. If you find yourself running the same transform every day, that is a rule waiting to be written.


4. Starting without breaking anything

The failure mode with automation is a rule that matches more than you meant, quietly, for a week.

Three habits that avoid it:

Start from the presets. The Starter Rules gallery holds one-tap versions of the common ones. Add, then adjust.

Match narrowly first. Add the source app to the match even when it feels redundant. A rule that only runs on copies from Safari cannot surprise you in Xcode.

Watch the first day. Every rule can be switched off without deleting it. If a rule fires on something it should not have, switch it off, tighten the match, switch it back on.

Also worth knowing: rules can opt out per rule of the things you have turned on globally, so one loud rule does not force you to change your setup everywhere.


5. The part that is easy to miss

The value here is not the seconds. Ten seconds of link cleaning, five times a day, is under a minute.

The value is the interruption. You were writing a reply. You pasted a link. Now you are editing a URL character by character, and when you look up you have lost the sentence you were composing. The task was small; the context switch was not.

A rule removes the interruption, not the keystrokes.


The short version

Clipboard rules turn the small repeated cleanups into something that has already happened by the time you paste. Match on app, type, length or text; clean, extract, compress, file, pin or burn. Start from a preset, match narrowly, and keep the off switch close.

See how rules work, or the full feature list.

Frequently asked questions

What can a clipboard rule match on?

The app you copied from, the clip type, its length, or its text using search syntax: a | b for either, -word to exclude, and quoted text for an exact phrase.

Can a rule clean tracking parameters automatically?

Yes. A clean-links rule strips utm_source, utm_medium, fbclid, gclid and the rest at copy time, so what you paste is the bare URL.

Will rules change my copies without telling me?

No rule exists until you add one. Starter Rules are presets you add in one tap, and each rule can be switched off or deleted.

Can a rule extract just part of what I copied?

Yes. Copy a signature block and a rule can keep only the email address or the phone number, so that is what lands on your clipboard.

Do rules work on images?

Yes. A rule can compress a copied image, or file every screenshot under a collection so they stop clogging recent history.