Quick TinyURLs with TextExpander and AppleScript

Posted by Jean

I just came across this neat tip on developer David Smalley’s blog. It uses AppleScript to generate a tinyURL with a TextExpander abbreviation.

(If you’re not familiar with Tiny URL, it’s an online service that converts long URLs into short ones more appropriate to share in email and microblogs.)

I am no AppleScript maven, but it sounded pretty cool. I’ve been using Tiny URL a lot lately since I started using Twitter. So I consulted Greg, whose works on TextExpander development, to see what he thought. His response:

This does work, and it’s quite convenient. Here’s an easy way for you to import this:

And he sent me the AppleScript wrapped in a TextExpander Group. You can download it here:
http://www.smileonmymac.com/textexpander/tinyurl.textexpander.zip

Download and unzip it, and then add the group in the TextExpander preferences pane.

Then you’re set to follow Greg’s instructions:

You select a URL, copy it to the Clipboard, then type “tinyurl” (and your delimiter if you’re not doing instant expansion) then wait a few seconds and “tinyurl” will be replaced by a tiny URL.

If you’re a real geek, you can grab the AppleScript from the original blog post and create your own AppleScript snippet in TextExpander.

3 Responses to “Quick TinyURLs with TextExpander and AppleScript”

  1. Henrik Says:

    Fantastic! Just got a Mac, and have been using Autohotkey on the PC before. I miss some features in TE, but this was a really, really nice tips. Gave me inspiration to create other applescript based replacements :)

    Thanks!

  2. Jean Says:

    @ Henrik: Great! If you create any Applescripts you want to share, send me an email (jean@smileonmymac.com). If we post your tip on the blog, we’ll give you a license to one of our other products as our thanks.

  3. JD Strong Says:

    This was a great start. I’ve added a little error checking and a faster call to the core TinyURL API here: http://jdstrong.com/textexpander_tinyurl_applescript

Leave a Reply