Get Tr.im With TextExpander

We’ve posted AppleScript TextExpander snippets that generate shortened URLs with bit.ly and TinyURL. A few weeks ago on Twitter, TJ asked if we couldn’t do one for the shortening service tr.im. I thought I would use TJ’s challenge as a personal one to push the limits of my limited geekiness and figure it out myself. I got as far as looking at the tr.im API, and thought “I’m not going to be able to figure this out without help.” Then I got busy with stuff and promptly forgot about it.

A few days ago, I saw this post and tried the script the author offers. It didn’t work for me, so I referred to my colleague Greg (aka he who knows all about TextExpander). He told me that:

The author is using a non-standard Unix tool (wget), i.e. not one which is installed with stock Mac OS X. It was fairly easy to replace his use of wget with curl, and so I’ve done.

I definitely would have never figured that out myself. You can download Greg’s revised AppleScript snippet and try it out. The zipped file contains a TextExpander snippet group (of one snippet) that you can add to your library by choosing “Add Group From File…” from the Add menu.

And you’re welcome, TJ. ;-)

6 Responses to “Get Tr.im With TextExpander”

  1. Gary Says:

    The original TinyURL snippet seems to have broken. I hadn’t used for months and then tried to use it about ten days ago. Nothing. Prompted by this article, I just tried it again and it’s still failing to return a URL. Pity…

  2. Jean Says:

    @Gary: I use JD Strong’s script (option #2 in the TinyURL post) and that is still working for me. Check it out: http://tinyurl.com/5c43v9

    But I have to admit that bit.ly and now tr.im are my favorites because the URLs are so much, well, tinier…

  3. Tj Says:

    WOW! What power I wield!

    Thanks for this! Not only are tr.im URLs shorter, but the tr.im website offers stats - STATS I SAY! - for how many people click on your tr.im URLs. (*)

    Who doesn’t love stats?!?!

    (OK, well I took Economic Statistics in college — BECAUSE I HAD TO! — and hated it. Dropped out 2 or 3 times before I finally completed the class — BECAUSE I HAD TO! — but that is a whole other story.)

    Many thanks!

    * (You may have to be logged into the tr.im service for this to work, and I haven’t verified that it will work with the TE shortcut, but still! Shorter Is Beautiful!)

  4. Tj Says:

    Update: ok, well it doesn’t seem to work with the stats but it seems to return MUCH faster than the TinyURL did.

    Thanks again!

  5. Gary Says:

    @Jean

    Thanks for the update. I must confess that I’d forgotten (so far) to come back and see if there was any followup to my comment. It was only when I saw Jeff Gamet’s post over at TMO that I picked up on this again - so, I’m sorted now.

    I’d not come across either bit.ly or tr.im before, whereas I am familiar with the long-established TinyURL. That gets it quite a bit of trust in the clicking-an-unfamiliar-link game… :-)

  6. SmileOnMyMac Blog » Blog Archive » TextExpander: Date and Time Math Says:

    [...] SmileOnMyMac Blog News, Photos, and User Tips from The SmileOnMyMac Team « Get Tr.im With TextExpander [...]

Leave a Reply