'Copied links' no longer pasting in certain applications

So, this is pretty weird. Copied links (i.e. using shift+cmd+c) no longer get pasted in several applications that I rely on. These include iTerm, Sublime Text, PyCharm, Things, NotePlan. By contrast, things still work fine in Notes, TextEdit, and in the search/URL bars of Safari and Chrome (though interestingly not website content, e.g. Google’s search box).

Weirder yet, when I check the Clipboard in Finder (Edit > Show Clipboard), I can see the copied link there. It just won’t paste for some reason in half of my applications.

I’ve tried disabling apps like Alfred where I suspected there may be some interference with the clipboard. Unfortunately, that didn’t change the outcome.

Anyone else seeing this?

I’m currently on v1.4 Preview (69) on macOS 12.5.

Thanks for reporting this. I see same behavior, will look for fix.

If you need an interim measure, pending the fix, I am finding that I can paste Bike links into applications which don’t accept/handle the public.url clipboard content directly, by using this Keyboard Maestro macro:

Paste as plain text.kmmacros.zip (2.1 KB)

(which, in this case, just creates a public.utf8-plain-text pasteboard item from the public.url clipboard content)

Or an interim script to copy a Bike link (for the current row) as plain text, which can be pasted anywhere.

Expand disclosure triangle to view JS Source
(() => {
    "use strict";

    ObjC.import("AppKit");

    const main = () => {
        const doc = Application("Bike").documents.at(0);

        return doc.exists() ? (
            copyText(doc.selectionRow.url())
        ) : "No documents open in Bike";
    };

    // --------------------- GENERIC ---------------------

    // copyText :: String -> IO String
    const copyText = s => {
        const pb = $.NSPasteboard.generalPasteboard;

        return (
            pb.clearContents,
            pb.setStringForType(
                $(s),
                $.NSPasteboardTypeString
            ),
            s
        );
    };

    // MAIN ()
    return main();
})();

See: Using Scripts - Bike

To test in Script Editor.app set the language selector at top left to JavaScript rather than AppleScript.

You can assign a Bike script to a keyboard shortcut using utilities like Keyboard Maestro and FastScripts.

Thanks for sharing!

The JS script is a nice interim fix. Since I use Alfred instead of KBM, I’ve put together a simple workflow that triggers the script on bike cpl.

Bike Alfred.zip (41.5 KB)

1 Like

Thanks – good reminder – I keep forgetting Alfred and LaunchBar.


Incidentally, in addition to copying, the script also returns the link as an output, so you could show it in a downstream notification if you wanted (for example to be sure that a link had been captured)

Screenshot 2022-08-13 at 13.52.39