Outlook and the missing custom URL scheme

Coming from the “dark side” of the IT, one of the things I really missed on my MacBook in the beginning was Microfost Outlook. Entourage just didn’t feel right so I went through trialing a couple of other Email software solutions before I finally settled with Apple Mail.

So when Office for Mac 2011 hit the streets I decided to give the new Outlook a go to see if the change back from Apple Mail to Outlook would be of any benefit for myself (in the end I kept Apple Mail for various reasons, but that’s another story, not relevant to this post and blog).

Email is an important part of my daily professional life and by the time Outlook 2011 was released, my workflow setup integrated already quite nicely with Apple Mail. So very shortly after starting operation “Back to Outlook”, I found myself confronted with a major drawback, Outlooks lack of support of a custom URL scheme, i.e. a way to create a hyperlink to a particular mail message. As I didn’t want to give up my Outlook testing at this early stage BUT couldn’t live without the ability to put a back-link to a mail message inside the tasks of my task manager (and other apps) I decided to spend some time on the problem to see if I could come up with an alternative solution.

Different approaches, like linking to the message file, to a copy of the message file or ,where possible, directly embedding the message file as attachment didn’t however give me full satisfaction. The message would show, however it wasn’t really THE MESSAGE but rather a copy of the latter. Thus, when, for instance, replying to the message, the real message inside Outlook would not get tagged as replied, a.s.o…

In the end I decided to implant a “custom” custom URL scheme by myself.

The idea was that I could open an Outlook message from AppleScript simply by running :

tell application "Microsoft Outlook"
 open message id theMessageID
end tell

where theMessageID would be the id of the mail message to open.

I then packed this little script inside a small AppleScript application which would basically do two things :

  1. register a custom URL scheme to itself (so that it could get launched by an URL)
  2. extract the message ID of the Outlook message from the URL and fire the above AppleScript with the extracted message ID

I won’t go any further into the aspects of developing such an application, there are enough resources out there (including documentation from Apple).

To get this working, all you have to do is :

  1. copy the helper app (LuMe96OutlookHelper.app) to the application folder
  2. create a hyperlink to your Outlook mail message using the following scheme :

If you now click this hyperlink, the appropriate Outlook Message should open.

Unfortunately there are some limitations to this method in regard to moving messages of IMAP accounts; here is why :

When moving a mail message of an IMAP account to a different folder, Outlook sends a move instruction to the IMAP mail server and then deletes the local copy of that message inside its initial folder. Afterwards, the (on the server-side) moved message gets downloaded as “new” message inside its destination folder. When downloading this “new” message, Outlook assigns a new / different message id to this message. For the time being, I have not been able to find a solution / work-around to this problem, other than not moving messages any more, but rather setting up smart folders.

This does not affect POP3 accounts as messages are moved locally and it seems, judging from feedback of different users, that Exchange accounts are not (or only rarely) affected, although I personally could not test the latter not having any exchange account.

On a side note I’d like to point out that, when talking “message ID” in this post, I do refer to the internal Outlook message ID and not the  messageID found in the mail header of the mail message. The latter remains obviously unchanged even if a message is moved, unfortunately it is not accessible through AppleScript.

You can download the latest version of this helper app here.

Take care.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s