Paste URLs without link text

I might be missing something, but is there any way to paste a copied link and only get the URL? For example, imagine I copy the link to the description of this chillin’ villain from Reddit:

https://www.reddit.com/r/DogPics/comments/1e253yh/comment/lczcv3d/

When I paste this link I get “7h ago”, hyperlinked. If I do “Paste and Match Style” I get “7h ago” not hyperlinked. But what I’d ideally like (because that text doesn’t really help me understand where the link goes) is to get the URL, hyperlinked.

You probably know that if:

  1. the Navigation Bar is showing, as above, and
  2. you hover the cursor over the clickable button at the end of the link,

then the URL is displayed in the Navigation Bar:


Yeah, that just isn’t so convenient when reading a document.

1 Like

In the meanwhile, if the front document contains Bike links in the default format (Label visible, URL concealed),

then you should be able to include the URL in the displayed text, in, for example a [label](url) format like the following:

by attaching a keystroke (with something like Keyboard Maestro or Fastscripts, perhaps) to an AppleScript of this form:

Expand disclosure triangle to view AppleScript source
tell application "Bike"
	tell front document
		if it exists then
			repeat with oRow in its rows
				tell oRow
					repeat with oAttrib in attribute runs of its text content
						set oLink to link of oAttrib
						
						if oLink is not missing value then
							set txt to oAttrib as text
							if txt does not contain "](" then
								set paragraphs of oAttrib to ¬
									{"[" & txt & "](" & link of oAttrib & ")"}
							end if
						end if
					end repeat
				end tell
			end repeat
		else
			"No document open in Bike"
		end if
	end tell
end tell

( Effects reversible with successive taps of ⌘Z )


See: Using Scripts | Bike

Whoa, thank you! I’ve been getting into Keyboard Maestro a bit so I will give this a shot.

I also thought of another workaround, which is to keep Pure Paste running, with auto clean mode active. This will result in pasting plain URLs, which Bike then turns into links.

2 Likes

For a Paste as Plain Text approach, you could also experiment with this Keyboard Maestro macro:

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

( assigned by default to ⌘⇧V )

1 Like

I will throw out another “workaround,” although I am stretching that term to its limits: The Vivaldi web browser has separate options on links for “Copy” and “Copy Link Address,” so you can easily get the address on its own. I doubt anyone’s going to switch browsers over this, but I’ll volunteer I am having a pretty good experience overall with Vivaldi.