The Mac Observer

Skip navigational links

TMO Quick Tip - More Instant TinyURLs from TextExpander

by , 7:30 AM EDT, October 22nd, 2008

I've mentioned TinyURL before because it's really great at shrinking long Web addresses down to a much smaller and more manageable size. I've also mentioned that you can automate the process with SmileOnMyMac's TextExpander and AppleScript. It's time to update that Quick Tip, because I've come across a different AppleScript that's even more reliable than the one I was using.

J-D Strong Consulting came up with their own AppleScript to automate the process of turning long Web addresses into much shorter TinyURL links. Like David Smalley's cool AppleScript, this one cuts the conversion process down to a couple of steps, but it's faster and even more reliable.


The TinyURL Web site.

Just like with David Smalley's script, you'll need TextExpander 2 -- the abbreviation expanding application that changes the text snippets you define into words or text blocks, and it can also run AppleScripts. It costs US$29.95 and you can download it from the SmileOnMyMac Web site.

You'll also need the TinyURL converter script from the J-D Strong Consulting Web site to transform any URL you copy into a TinyURL.

After you have all of the pieces, here's what to do:

  • Copy the AppleScript code from the J-D Strong Web site.

  • Copy the AppleScript code from the J-D Consulting Web site.
  • Launch TextExpander. You can either choose TextExpander Preferences from the TextExpander menu bar item, or launch System Preferences and click on the TextExpander Preference Pane icon.

  • Don't forget to choose AppleScript when adding your new snippet.
  • Now click the plus button in the lower left corner of the Preference Pane and choose New Snippet.
  • Paste the AppleScript code into the Content field on the right.
  • Now choose AppleScript from the Content pop-up menu at the top of the Content field.
  • Add a snippet name that's easy for you to remember to the Abbreviation field. Make sure it's something easy to remember, like "tinyrul."

Here's how to use your new TextExpander script:

  • Select and copy a URL you want converted into a TinyURL.
  • Place your cursor where you want the TinyURL to appear.
  • Type tinyurl -- which is the pre-assigned abbreviation for the AppleScript that generates the TinyURL for you.
  • The TinyURL version of the Web address will automatically appear at your cursor insert point.

I was having some trouble recently with the original AppleScript I was using, but I found the script from J-D Strong Consulting to be completely reliable in all of my tests. Yes, I did most of my testing with Twitter, but you can use this trick in other applications, too.

Just like the script I used before, I found this new one to be wonderfully useful and a great time saver. If you are interested in seeing more about adding scripts to TextExpander, be sure to check out my Quick Tip on using the first TinyUL script I found.


Jeff Gamet is TMO's Morning Editor and Reviews Editor. He lectures, teaches and speaks on Mac OS X and design-related topics, and is the author of The Designer's Guide to Mac OS X from Peachpit Press.

if you have tips or tricks to share, or Mac-related questions you want answered.

Jeff Gamet is TMO's Managing Editor and Reviews Editor. He lectures, teaches and speaks on Mac OS X and design-related topics, and is the author of The Designer's Guide to Mac OS X from Peachpit Press.

Observer Comments

Show: Subjects Only | Full Comments
Close Name:Guest
Subject: Can that script be applied to other services?

Like bit.ly and snurl?

Close Name:macgenie Posts: 5 Joined: 23 Mar 2007
Subject: Scripts for bit.ly and tr.im

If you go to our blog at http://www.smileonmymac.net/blog, we just posted a tip for using TextExpander with tr.im. There's a link there for another post that shows you how to do it with bit.ly.

Close Name:Guest
Subject: URL for script incorrect

http://smileonmymac.net/blog/

Close Name:macgenie Posts: 5 Joined: 23 Mar 2007
Subject: That is really weird!

I don't know what happened with that link. Here are direct links to the posts about bit.ly: http://bit.ly/4ir7RF and tr.im: http://tr.im/hui

Close Name:Guest
Subject: easier way: only 1 click

there's a much easier way to create a tinyurl from a webpage you're visiting, without using Applescript or Textexpander.


first, just go to this page on the TinyURL website:
Add TinyURL to your browser's toolbar
http://tinyurl.com/#toolbar

drag the link they specify there to your Safari toolbar. this creates a one-step bookmarklet

now whenever you're viewing a website, you can simply click on that bookmarklet, and a tinyURL will be created for the page you were viewing.
One click.

Close Name:vftk Posts: 14 Joined: 01 Aug 2007
Subject: easier way: only 1 click >> not really

@Guest
> first, just go to this page on the TinyURL website:
> Add TinyURL to your browser's toolbar
> http://tinyurl.com/#toolbar
<snip>
> One click.

There is some merit in your suggestion, and I'll be trying out the toolbar shortcut. Thank you.

However... There doesn't seem to be a way to use it without "losing" the original browser page. You must click on the [Back] button (or use the keyboard shortcut, or whatever). On a page that perhaps has a lot of advertising - and therefore loads slowly - this is an distinct irritation. And then you have to change to the application in which you want to use the TinyURL. And then you have to paste it.

Actually, I make that four steps.

I suspect that I'll prefer to continue to do the following:
(1) [cmd]-L , [cmd]-C
highlight and copy the target URL
(2) [cmd]-[tab]
switch to, say, Mail
(3) type "tinyurl"
to trigger the shortcut.

Three steps - and it maintains the status quo.

Comment on this Article


You cannot edit your comments.   You cannot delete your comments.

Comments are currently closed. Please email the author instead.


The Mac Observer Reader Specials

  • TypeStyler For Mac OS X is Now Shipping! Download The Free Fully Functional 60 Day Tryout at www.typestyler.com
  • RamJet Memory: Mac Pro 8-core 8GB Kit $199.99, 4GB Kits $109.99! Sale on MacBook and MacBook Pro 8GB kits $549.99! New MacBook DDR3 2GB for $49.99. iMac and Mac mini 4GB Kits for $79.99! 1TB SATA Hard Drives for $109.99! Click here
  • OWC: Plug & Play Hardware RAID up to 8.0TB. High Performance, Data Redundant Solutions. FireWire 800, FireWire 400, USB2, or eSATA. Hot Swappable Bays, Data Rates over 200MB/s. Click here
  • Poker Mac If you're using a Mac, then you've gotta check out Full Tilt Poker for Mac. This Full Tilt Poker bonus code does the unthinkable, it actually rewards!
  • For the latest Apple products use Ciao, a price comparison website, to find laptops like MacBook Air. Then find the best prices on MP3 players and use our comparison tool to evaluate mobile phones like the Apple iPhone.

  • Laptop Hardware Provided by TechRestore - Overnight Mac & iPod Repairs.
  • __________
  • Buy Stuff, Support TMO!
  • Podcast: Mac Geek Gab
  • Podcast: Apple Weekly Report
  • TMO on Twitter!