
Brett Terpstra
Brett is a writer and developer living in Minnesota, USA. You can follow him as ttscoff on Twitter, GitHub, and Mastodon. Keep up with this blog by subscribing in your favorite news reader.
I’ve started going through and cleaning up my large collection of TextExpander snippets, starting with the ones I share publicly. In the process I’m moving away from my homebrew snippet sharing system to using TextExpander’s new(ish) public snippet groups. Once I’ve pruned and updated all of the groups in the te-snippets tool, I’ll redirect that page to a list of my publicly shared snippet groups.
Much like my custom tool, TextExpander sharing lets you define your own prefixes for the group, and it doesn’t take a bunch of XML foolishness on my end to make it work. I like it.
The first group up for a refresh was my “Tools” group, which is kind of a general collection of tools for text, Markdown, and miscellaneous tasks like getting the front Finder window path.
You can find the new group as “Brett’s Tools” on TextExpander.com. Some of its original contents are being moved into more specific groups, and a bunch of the snippets got updates. Only a few had to be removed due to APIs being discontinued or other issues that have popped up.
There’s a new snippet for creating obfuscated mailto:
links. It pops up a fill-in for link text, email address, and optional subject line, then spits out an HTML tag that uses a combination of JavaScript and unicode encoding to completely obfuscate the link, including the “mailto” part, so bots are less likely to pick them up. I’ve gotten to the point where I’m getting as much spam from contact forms as I ever got from just putting my email address out there, so in a lot of applications I’m just back to using mailto
links. Obfuscating is of questionable value overall, but the general consensus on it is “it’s better than nothing.” This snippet makes it easier to just do it.1
I also updated the “swear” snippet (which turns your swears into “f#@!” for you) to include first letter of censored word. It’s just more fun that way.
Snippets that generate urls now assume https, rather than http.
The “Slugify” snippet (which turns “hey there” into “hey-there”, mostly for file naming purposes) now removes all non-alphanumeric characters and compresses multiple hyphens.
Anyway, check out the shiny new result here. Watch for more updates soon!
There is, of course, a concern about using JavaScript because it’s possible a user won’t have JavaScript enabled, in which case they’d be left with a non-functioning link and no way to contact you. I have an alternate version of this that uses entity encoding, but it’s so rudimentary that I feel like you might as well just use plain text.↩
Ok, so we’re all in Zoom way too much these days. We’re clicking links in calendar entries, Slack messages, and emails. They’re opening a browser tab every time, which then opens Zoom. I wrote a little script to clean up all those tabs, but that’s a kludge. Choosy is better.
I’ll start with the very simple tip: in Choosy you can add an advanced rule that targets any URL containing “zoom.us” and have it open directly in Zoom, completely bypassing your browser. You don’t even have to add Zoom as a browser in Choosy, just select “Browse…” from the dropdown list when specifying what browser to use and find “zoom.us” in your Applications folder.
There have been a few “default browser” apps for macOS over the years. Notably BetterTouchTool can function as one now, doing all kinds of neat tricks with your urls. The thing is, I’ve never seen one that has the perfect combination of ease and power that Choosy pulls off. Choosy is a breeze to set up, offers a great popup menu either horizontally or in a circle around your cursor, and has all of the advanced features you need.
You can specify all the browsers you’ll ever use, and set their order of preference. You can have Choosy always use the best running browser, only asking you to select one if none are running. Or you can have it offer you a selection of all your browsers, just your running browsers, or automatically assume it should use your favorite if no others are running. It can even expand shortened URLs for you on the fly.
This is all great if you’re a developer and constantly using every browser out there. But it’s also handy for anyone that has some sites that need a specific browser that’s not their preferred browser. You know, the sites you keep Chrome around for even though you prefer Firefox or Safari for everything else. Or, as illustrated above, a need to open links in an app that isn’t normally able to capture URL clicks.
What makes all of that possible is Choosy’s custom rules. Under advanced preferences you can build rules like the Zoom one above. You can have specific url patterns trigger specific browsers. Or have one that detects local HTML file clicks and lets you choose whether to open them in your browser or your text editor (yes, you can add your favorite editor as a browser option). My setup defaults to the best running browser, but if I hold down option when clicking a link anywhere on my Mac, I get a menu of all available browsers. Everything is customizable.
It even has an API and url scheme, so it’s a breeze to integrate into things like bookmarklets and shell scripts.
I know there are other tools like this, and I’d love to hear about your favorites in the comments, but Choosy has served me well for longer than I can remember. It’s absolutely worth the ten bucks, even if just to curb your Zoom tabs.
Choosy is available at choosyosx.com.
Web excursions brought to you in partnership with Udemy. Learn Anything.
I made a quick PopClip extension today for adding hard line wrapping to blocks of text. In general I’m a fan of letting text wrap automatically, but when I’m coding I prefer hard line breaks at 70-80 columns. Easy to do in almost any decent text editor, but elsewhere (ahem, Xcode) I wanted a fast way to do it.
You can install the extension from the latest version of Brett’s PopClip Extensions (download directly below), and the source is available on GitHub.
Credit for the heart of the wrapping code goes to Allan Odgaard of TextMate fame because why reinvent the wheel?
When you install the extension you can define the column at which the text will wrap. You can also define an alternate column, which can then be accessed by holding down Option when clicking the extension (which shows up as \n
in your PopClip bar). Holding down Command will unwrap selected text, removing newlines at line endings but preserving multiple consecutive newlines and trailing space.
Just a quick side project, but I thought others might find it useful. Of course, I’d bet money something like this already exists, but it was a nice break from other tasks anyway.
Download Brett’s PopClip Extensions v1.27
A few PopClip extensions for Markdown writing and other useful tools
Published 11/30/14.
Updated 02/11/21. Changelog
Thanks to TextExpander for sponsoring BrettTerpstra.com this week! I’m a huge fan, and my life without TextExpander would be very tedious, indeed.
TextExpander removes the repetition out of work so you can focus on what matters most.
Say goodbye to repetitive text entry, spelling and message errors, and trying to remember the right thing to say. Have the right response for the right occasion always at your fingertips on any device.
Better than copy and paste, better than scripts and templates - TextExpander snippets allow you to maximize your time by getting rid of the repetitive things you type while still customizing and personalizing your messages.
TextExpander can be used in any platform, any app, anywhere you type.
Take your time back and increase your productivity. My readers get 20% off their first year! Visit textexpander.com to learn more.
I did a little more weekend work on Bunch, and I’ll probably post an update on some exciting new stuff soon. I’d love it if you helped test by downloading the beta version and checking the changelog to see what’s up. Anyway, that’s not the point of this post.
As part of working on the new release, I’ve been doing a lot of documentation. And because the documentation has continued to grow, there’s been a lot of reorganizing. And as a result of that, I keep breaking links between pages. So I made a quick tool to make finding broken links easier.
Web excursions brought to you in partnership with MindMeister, the best collaborative mind mapping software out there.
If you’re not keeping up with the latest in Bunch, there have a been more updates since my last post. I’d love to have as many beta testers as I can right now, so give it a shot!
Check out MindMeister and start brainstorming, collaborating, and boosting productivity.
Thanks to Unite 4 from BZG for sponsoring BrettTerpstra.com this week! I’d been missing a good, modern app for making Single Site Browsers, and Unite came to the rescue. I highly recommend it!
Unite 4 for macOS allows you to turn any website into an app on your Mac. Using a lightweight, WebKit powered browser as a backend, you can easily create isolated, customizable apps from any site.
Unite 4 includes dozens of new features, including support for native notifications, new customization options, and much more. Unite apps also serve as a great alternative for resource hogging Electron apps or half-baked Catalyst apps.
Some examples of apps you could create in mere minutes with Unite:
BrettTerpstra.com readers get 20% off this week when you purchase Unite 4 at bzgapps.com/brett or when you use the promo code Brett
at checkout.
You can also try Unite for 14 days absolutely free or use it as part of your subscription if you’re a Setapp subscriber!
Are you ready? I kinda went down a rabbit hole with Bunch this last week. It’s a lot. Because this release is so big, I’m releasing it as a beta first. All of the documentation for the new version is at brettterpstra.com/bunch-beta/docs, and the download link can be found at brettterpstra.com/bunch-beta/download.
The documentation for everything here is fully updated (and expanded, as part of the aforementioned rabbit hole), and all of the pertinent pages are linked from the changelog. You can just skip there if you like.
First, the blame for this whole development cycle belongs partially to one Jake Bernstein. He had a couple ideas that I thought were pretty clever, and it was a slippery slope from there. Scheduled Bunches and Spotlight searches were mostly his fault. I’m far from blameless in this, but just I want him to share in the responsibility. Well, really I just wanted to give him credit.
The first big thing is that I’ve introduced frontmatter. It’s YAML-esque formatting that lets you define attributes and variables at the top of your Bunch file. This means additional settings without further complicating the syntax. Just nice, readable keys and values.
---
title: 👍🏻My Cool Bunch
startup: true
---
First benefit: you can use a title
key to define a display name that’s different from the filename. Which, of course, means that you can use emojis in your menu titles. A vanity feature, but I really like it.
You can define whether a Bunch launches at startup with the startup
key, as an alternative to using startup scripts.
You can also define arbitrary keys and values that can then be referenced as variables in your snippets.
I know what you’re asking yourself at this point. “Did he really stop with just having static data at the top of a file?” No, of course not. Frontmatter can also be dynamically loaded from external files or shell script output.
So that’s nice and all, you say, but is there any real benefit to having frontmatter?
Ok, one more batch of updates for Bunch. It’s just so much fun to work on that I spent last weekend on it. Don’t worry, nvUltra is getting an equal amount of love.
By the way, if you want to keep tabs on all of my latest work, apps, and special discounts, I formally invite you to subscribe to my new email list. It’ll be low-traffic and a great way for me to let you know about the important stuff.
Anyway, Bunch…