OS X Lion: Track Shipments in Mail

| TMO Quick Tip

If you’ve ever ordered something online, you have probably been sent a shipping notification with a tracking number. Wouldn’t it be cool if you could just click on that tracking number in your email and be able to view the tracking details? With OS X Lion’s Mail, you can.

Through the “data detectors” coded into OS X Lion, Mail is able to detect a tracking number from USPS, UPS, and FedEx. When you hover your mouse over a tracking number Mail detected a dotted rectangle with a pull-down menu appears around that tracking number.

OS X Lion MailClicking into the contextual menu for a tracking number in Mail

If you click the pull-down menu, you’ll find an option labeled “Track Shipment.” Click it, and voilá! Your tracking details, from the carrier, show up in a quick view window.

OS X Lion MailUPS Tracking Information in OS X Lion Mail

The window displaying the tracking information won’t allow you to interact with the shipping Web page, but there is an option to open the page with your default browser. The feature is very helpful for seeing where your new iPad is while it’s being shipped from China or when the textbooks you ordered from Amazon will appear on your doorstep.

In my testing, the feature only works with USPS, UPS, and FedEx shipments. Unfortunately, Apple doesn’t allow users to add new data detectors, so our Canadian friends can’t add tracking for Canada Post.

Comments

Lee Dronick

Wow! That will be handy.

Gary

> ?data detectors? coded into OS X Lion, Mail

Last week I was tracking the delivery by UPS of my new iPad (3rd Generation) - using this same mechanism on my iPad 2.  So it’s not just the Lion Mail client…

Jeff Butts

So it?s not just the Lion Mail client

You’re absolutely correct, it’s not just Lion’s Mail client. That feature’s been in iOS’s Mail app since iOS 4.0 or 4.1. It is, however, new to OS X; the feature did not exist in Snow Leopard unless you installed an add-in program to extend Mail’s capabilities.

Gary

It is, however, new to OS X

Sorry Jeff - I’d assumed it was new across the boards.  It’s still cool though!  grin

Chris

thanks for the reminder about these features of mail.  very handy indeed.

iJack

I had to go back and read this article again, because I couldn’t understand what the oh-gee-whiz fuss was about.

I’ve been doing this in Thunderbird for several years.
It looks like just the tracking number, but the url is indeed imbedded.

Jeff Butts

It looks like just the tracking number, but the url is indeed imbedded.

I just looked at the raw source of the email I used for my screenshots. There is no URL embedded; Apple’s data detectors are recognizing the number as a UPS tracking number and enabling the “Track Shipment” contextual menu item.

This is much more in-depth than I felt appropriate for a quick tip, but the data detectors work by incorporating regular expressions (regex). In programming terms, OS X is looking for anything that matches the pattern “/\b(1Z ?[0-9A-Z]{3} ?[0-9A-Z]{3} ?[0-9A-Z]{2} ?[0-9A-Z]{4} ?[0-9A-Z]{3} ?[0-9A-Z]|[\dT]\d\d\d ?\d\d\d\d ?\d\d\d)\b/i” and then flagging it as a UPS tracking number. OS X developers can also make use of these data detectors by including NSDataDetector (a derivative of NSRegularExpression) from Apple’s SDK to incorporate the data detectors in their own applications.

Gary

Apple?s data detectors are recognizing the number as a UPS tracking number

Indeed.  If you don’t believe Jeff, it’s easily demonstrated if you have, for example, a valid UPS number.  Just copy the number, paste it into a plain text email and send it to yourself…

iJack

Jeff, Gary ? Read my comment again.
I said I had being doing it in Thunderbird, not Mail.

Gary

I said I had being doing it in Thunderbird, not Mail.

iJack - I wasn’t disputing that.  But you commented that the ‘trick’ was accomplished simply by having the URL hidden behind the tracking number.  (And I’m not saying that hasn’t happened in the past.)

We were talking about the use of Apple’s Data Detector functionality not requiring the presence of the URL; simply recognising certain types of data and knowing how a user is likely to want to interact with that data.  Distinguishing between, for example, phone numbers, dates - and now -the tracking numbers from certain companies.

I think we’re talking at crossed purposes…  grin

Log-in to comment