This Week's Sponsor:

Kolide

Ensures that if a device isn’t secure it can’t access your apps.  It’s Device Trust for Okta.


How To Create a Lessn, Bit.ly, Is.gd, Tinyurl Desktop Shortener with Applescript

If you daily send a lot of links to your friends / Twitter followers it’s very likely that you’ve started using a URL shortener. It’s fast, easy and so web 2.0 to send a shortened URL, you can’t deny it. But as the url shortening mania exploded, so has the url shortening services: Tinyurl, Bit.ly, Tinyurl, Tr.im, Is.gd, J.mp, there are hundreds of shorteners out there.

Then, there’s the “your own URL shortener” trend: just as I did with mcstr.es, I purchased a short domain and installed lessn from Shaun Inman to generate short urls for MacStories links. Sure, lessn is not the only application which allows to acheive this (Yourls, for example, seems to be used by many people) but I like its interface and installation process more than others.

Now, if there’s one thing all these url shortening services miss it’s a desktop app to shorten links. I mean, an application that supports every service so that the users can choose which one to use.

For this reason I asked @andytuba (website) to build an Applescript for that.

And guess what, it’s awesome.


This Applescript will shorten the url you have pasted in your clipboard and allow you to copy the shortened url.

As I told you before I use lessn from Shaun Inman so I’ve set up the Applescript to shorten urls based on my lessn installation. But the script also supports Tinyurl, Bit.ly and Is.gd, if you don’t have your own short domain.

First, download this file and move it to /Library/Scripts/Safari. Then,open it with Applescript Editor and choose your url shortener in this string:

– Choose your URL shortener: set Shortener to “Bitly” (default), “Lessn”, “Isgd”, or “Tinyurl”

set Shortener to “Lessn”

As you can you just have to put the shortening service you’d like to use between the “”. Bit.ly comes enabled by default. If you choose 3rd party services like Bit.ly or Is.gd the script is ready, but if use lessn you’ll have to fill two additional fields.

– If using Lessn, set LessnURL and LessnAPI to the appropriate values

set LessnURL to “” – Your installation of lessn set LessnAPI to “” – Your API key (shown after logging in to your Lessn installation on the web)

Pretty self explanatory, you’ll have to paste the url of your lessn installation and your API key.

That’s it.

This Applescript is meant to be used with FastScripts from Red Sweater, which lets you assign keyboard shortcuts to your scripts or launch them from your menubar.

Go download it, it’s free!

Unlock More with Club MacStories

Founded in 2015, Club MacStories has delivered exclusive content every week for over six years.

In that time, members have enjoyed nearly 400 weekly and monthly newsletters packed with more of your favorite MacStories writing as well as Club-only podcasts, eBooks, discounts on apps, icons, and services. Join today, and you’ll get everything new that we publish every week, plus access to our entire archive of back issues and downloadable perks.

The Club expanded in 2021 with Club MacStories+ and Club Premier. Club MacStories+ members enjoy even more exclusive stories, a vibrant Discord community, a rotating roster of app discounts, and more. And, with Club Premier, you get everything we offer at every Club level plus an extended, ad-free version of our podcast AppStories that is delivered early each week in high-bitrate audio.

Choose the Club plan that’s right for you:

  • Club MacStories: Weekly and monthly newsletters via email and the web that are brimming with app collections, tips, automation workflows, longform writing, a Club-only podcast, periodic giveaways, and more;
  • Club MacStories+: Everything that Club MacStories offers, plus exclusive content like Federico’s Automation Academy and John’s Macintosh Desktop Experience, a powerful web app for searching and exploring over 6 years of content and creating custom RSS feeds of Club content, an active Discord community, and a rotating collection of discounts, and more;
  • Club Premier: Everything in from our other plans and AppStories+, an extended version of our flagship podcast that’s delivered early, ad-free, and in high-bitrate audio.