Six Colors
Six Colors

This Week's Sponsor

Magic Lasso Adblock: YouTube ad blocker for Safari


By Shelly Brisbin

SearchLink removes the drudgery from making web links

My classic movie podcast, Lions, Towers & Shields over at The Incomparable, uses a standard show-notes format. On each episode, we talk about one old movie, and I always link to places where you can stream it, buy physical media, and learn more about the film we’re watching. Even after I came up with a standard Markdown template I liked, I found myself doing a whole lot of tinkering, mostly Web searches, for each episode’s notes. So I decided to automate the process. I now have a macOS workflow that saves me lots of time.

My TextExpander snippet contains Markdown for my show notes, including SearchLink codes and fill-in fields for the movies.

I initially dropped my Markdown template for the show notes into a TextExpander snippet with a fill-in field for the movie title. I put in placeholders for all my links and their labels. I’d expand the snippet into a Drafts note, launch a browser, and open a folder full of the bookmarks I needed to perform my searches – IMDB, YouTube, Amazon, the past LTS catalog. All the while, I’d listen to the raw episode, editing between searches and writing down possible episode titles. The template kept my posts looking consistent, but filling it out was tedious, what with all the searches and copy/pasting.

Let the machine do it

Enter SearchLink, a tool from Brett Terpstra that installs as a system service in macOS. At the most basic level, select text in a document and have SearchLink search Google, returning a URL. Or, using Markdown syntax, return a label and its link. It’s how I quickly pulled the links I’ve included above, though I did replace the App Store link initially offered with one to the Drafts website.

There’s a lot more to SearchLink. You can specify a site you want to search and parameters within that search to get just the URL you want. A number of popular sites are already coded into SearchLink, so you just need to indicate the one you want, like this:

Apple's [latest pro iPhone](!a iPhone 14 Pro)

Right-clicking on this Markdown code and choosing the SearchLink service returns an Amazon link to the iPhone 14 Pro, with the product name as the Markdown link label. ! a tells SearchLink to search Amazon.

SearchLink has built-in hooks for lots of commonly searched sites, including the Mac App Store and other Apple directories, Wikipedia, your pinboard bookmarks, browser history, and lots more. You can also search Twitter, Instagram, and other social networks.

Custom-built searches

In addition to Amazon, where I link to physical media for the movies I cover on LTS (we’ll come back to this), I need to search IMDB, YouTube, JustWatch, and my own LTS back catalog. To support these, I edited the SearchLink configuration file, an invisible file that lives at the root of my user folder. Now I have commands for each of the sites I need:

  • !im = IMDB
  • !yt = YouTube
  • !jw = JustWatch.com
  • !lts = the Lions, Towers & Shields directory at The Incomparable

So I use this line to return the IMDB for The Manchurian Candidate, which will be episode #65.

[The Manchurian Candidate 1962](!im The Manchurian Candidate 1962)

I specified the release year because there’s been a remake. IMDB searches can often turn up the wrong thing, so if I’m looking for a common-seeming title, I’ll make my search as specific as I can.

The next link I want is to a trailer. I go to YouTube for these, and here’s what I search on:

[trailer](!yt The Manchurian Candidate 1962 trailer)

Notice that the label just says, “trailer.” In my template, this link appears right next to the movie title, so I don’t want to repeat the title. Here’s what I get back from SearchLink:

[trailer]](https://www.youtube.com/watch?v=Oc8LpuM5Bhs)

Here’s how I make my Amazon search better. I use Amazon to find Blu-ray or DVD versions of the movies we watch. For streaming, I use JustWatch.com because I can give readers a broader array of choices for renting or buying the movie digitally and because lots of classic movies simply are not streaming, so I need to confirm.

But if I search Amazon by movie title, I’ll usually get a link to Prime Video instead of a physical media link. So I narrow the search by adding “+DVD” to the query. I tried “Bluray” and “blu-ray,” but even though the latter literally appears in URLs from Amazon, my searches weren’t working reliably. Besides, some movies I cover are only on DVD, so it’s the safer search. The results page I get will show all physical media options available. Here’s my query:

[Blu-ray](!a "The Manchurian Candidate 1962" +DVD)

I’ve put the title in quotes to be as specific as I can, and I’ve left “Blu-ray” in the label because that’s what I’m linking to, more often than not. When I check the links, I can replace the label with a DVD or something else if needed. I get this link back:

[Blu-ray](http://www.amazon.com/dp/product/0792838289/ref=as_li_ss_tl?ie=UTF8&linkCode=ll1&tag=shellybrisbin-20)

Here’s how my show notes look after I’ve run all the SearchLink commands.

This takes me to the correct page, with links to all the physical media options for this movie. Notice, too, that my Amazon affiliate link appears at the end. I added that into the SearchLink configuration file as part of the !a syntax. Slick, huh?

Now here’s my favorite part: Often, during LTS episodes, we find ourselves referring back to movies we’ve previously covered. I created a section in the show notes called The Self-Referential LTS. Not having my episode numbers committed to memory, I found myself searching the site to link up those old episodes. Now, SearchLink helps me. In my template, I drop this bit of code:

[LTS # ](!lts Laura)

…where “Laura” is the movie and episode we’re referring back to. When I get the result, I still have a little work to do. I have a URL from my directory at theincomparable.com. I’ll copy and paste the link into a browser to be sure it refers to the episode and not some other reference to “Laura.” Also, because my syntax in show notes for references to past episodes is:

LTS #<episode title>

I need to grab the number from the link and the title from the episode page – the movie title is in another field called Summary. Because The Incomparable site displays titles in all caps, I’ll run another TextExpander snippet on the title – now on the clipboard – to change the case to Initial Caps when I paste the title back to Drafts. And here’s my final Self-Referential LTS link:

[LTS #35 Aspirational Spaces](https://theincomparable.com/lts/35/)

At the end of each episode, I announce the next movie we’ll watch, so listeners can check it out beforehand. In the notes, I give the name of the next movie and a link to its IMDB page and its trailer. My TextExpander snippet has a second fill-in field for the upcoming movie. So when I activate the snippet, I’ve got the correct search terms for both movies.

This Drafts preview shows the final links and formatting for my show notes.

Odds and ends

If you think it would be more convenient to run a file containing a Markdown template through SearchLink, rather than resolving links individually, you’re right. Do that by right-clicking your text file and choosing SearchLink from the Quick Actions menu. But to be sure the links are dropped where you want them, you first need to edit the SearchLink config file and change inline from false to true. Honestly, I do my links individually because I need to check them anyway, and there’s time while I listen back to the episode. Your mileage may vary.

Instead of right-clicking/dragging to activate SearchLink, you can assign it a keyboard shortcut via System Settings/System Preferences. I assigned the keyboard shortcut to a button on my Stream Deck.

SearchLink is a powerful tool, and Brett has written detailed documentation that was a huge help as I worked out my process. You can do lots more to customize your searches. SearchLink is one of Brett Terpstra’s many free tools, but if you use and enjoy this sort of thing as I do, you should send him a donation.


Search Six Colors