banner



How To Send Youtube Link Without Preview

I spend a lot of fourth dimension in Messages in macOS, and one of its newer features is something called link previews, as seen at the correct side of this text block.

While these previews can occasionally be useful, most of the fourth dimension, they're just annoying: I'm talking with people I know, and we trust the links we ship each other, so the preview is superfluous. Plus it makes information technology near impossible to rickroll anyone. But what'southward really annoying is that they make it impossible to send messages like this:

Oh, take you seen [paste copied URL]http://www.istocknow.com?

Endeavor that, and the URL becomes a preview, and the question mark vanishes. It really interrupts conversational flow. Yous can forbid this by either writing text on both sides of the pasted URL, or surrounding the URL with angle brackets:

Oh, take you seen <[paste copied URL]http://www.istocknow.com>?

So there's the quick tip: To prevent link previews, environs your pasted links with either text on both sides, or more simply, bending brackets.

A cleaner solution: Employ a dot at the front and finish of the URL. Letters will make the dots vanish (if the URL is on its own line, otherwise it leaves the leading dot), and yet not preview the bulletin. Thanks to reader Christopher for this tip—using it, URLs pasted on their ain line are only clean URLs, no previews, no brackets. I updated my macro, changing the brackets to dots in the relevant steps. I haven't edited the version you lot see hither, though.

But considering I often forget to do that, I wanted it to be automated. Thanks to Keyboard Maestro, I was able to make that happen: When I paste a link in Messages—using the system's standard ⌘Five shortcut—it'southward enclosed in angle brackets. If I paste annihilation other than a URL, information technology's pasted as is. If I do want a preview, I tin use the actual Paste menu item instead to get a link with preview.

This solution is perfect for my needs, as I e'er use ⌘V to paste, and I so rarely want to transport a link preview that it's OK that it requires a trip to the menu. (If information technology ever does annoy me, I'll merely remap Paste in Letters to ⌃⌘V or somesuch.

I can use ⌘V to actuate my macro (without doing anything to Messages' Paste shortcut) because Keyboard Maestro (and other apps that trap keystrokes) trap them earlier the background app sees them. With my macro assigned to ⌘V, Keyboard Maestro activates the macro and Messages never sees the ⌘V keystrokes.

With that knowledge, the macro itself is very simple, with 1 niggling bit that threw me off for a while. Here's how information technology looks, and as always, you can download for your ain use.

As discussed, the trigger is ready to ⌘V, and then I don't have to remember anything to brand this work. The logic of the macro is all in the if conditional: I check to run into if the current clipboard detail starts with http. (The ^http construct is a regular expression, and the carat means "find from the offset," so information technology won't lucifer a sentence that contains a link, for case.)

If there is a lucifer, Keyboard Maestro types the left angle bracket, pastes the clibpboard, then types the right angle bracket. If in that location isn't a match, and so the macro simply pastes whatsoever's on the clibpoard.

The one "gotcha" that threw me off for a bit was that I originally wrote this using Keyboard Maestro'due south Paste action. In the final version, I paste by using the Select a Menu Item action to actually select Edit > Paste. Why is that?

It turns out that Keyboard Maestro'due south Paste activeness works by sending ⌘V to the application. When it does that, information technology triggers the macro again, which sends another ⌘5, which triggers the macro again, which…well, y'all get the recursive motion-picture show. The end result wasn't pretty.

One time I figured out that little workaround—good to know for other macros going forward, also—eveyrthing worked as expected. So if y'all dislike sending link previews, try this macro; I love how it "simply works" and doesn't require a new keyboard shortcut or changing my behavior in Messages.

Source: https://robservatory.com/automatically-prevent-messages-url-previews/

Posted by: aokiafteptips.blogspot.com

0 Response to "How To Send Youtube Link Without Preview"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel