This week's sponsor

Atoms

The World's First Shoe to Come in Quarter Sizes


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 MacStories Extras

Club MacStories offers exclusive access to extra MacStories content, delivered every week; it's also a way to support us directly.

Club MacStories will help you discover the best apps for your devices and get the most out of your iPhone, iPad, and Mac. It'll also give you access to advanced iOS shortcuts, tips and tricks, and lots more.

Starting at $5/month, with an annual option available.

Join the Club.

A Club MacStories membership includes:

  • MacStories Weekly newsletter, delivered every week on Friday with app collections, tips, iOS workflows, and more;
  • MacStories Unplugged podcast, published monthly with discussions on what we're working on and more;
  • Monthly Log newsletter, delivered once every month with behind-the-scenes stories, app notes, personal journals, and more;
  • Access to occasional giveaways, discounts, and free downloads.