Obtain Outlook Email Link in Desktop App

Is there anyway of obtaining an email message url that can be pasted into Things 3? I have Hookmark (previously Hook), but it doesn't work with Outlook.

Hey Simon,

I don't think this is possible.

You should ask the Hookmark people – they would likely have added M$O emails if it was possible and should be familiar with the issues involved.

Do some research and complain loudly to Microsoft.

-Chris

That's a shame. I searched, but all solutions were 5 years ago and don't work with the current version of Outlook.

If I drag an email from Outlook into Things on my mac it gives me a file:///... link to the email .eml file. Is there any way to convert that to a link that will open with outlook? Currently a doubclick opens it in the Mail app and I don't want to change this default behaviour.

It seems that Hookmark works with the old Outlook. Just tried it and this is true.

It also seems that applescript has been moved back by Microsoft until March 2023 :roll_eyes:

Disgusting...

I doubt this control panel will work past macOS 10.x, but with it you can manually play with MIME types:

Rubicode - RCDefaultApp

image

It's likely this could be done without the control panel using the Defaults system or perhaps Swift, but I personally wouldn't know how.

I'm thinking there is an example or two of changing the default for HTML (Web Browser) on this forum, and there might be some information available on the Script Debugger Forum.

An alternative is to have a macro that selects your link instead of clicking it and then sends the .eml file path to Microsoft Outlook to open.

So you do have some options.

This AppleScript will create a link to the currently-selected Outlook email message:

tell application "Microsoft Outlook"
	set selectedMessages to selected objects
	if selectedMessages is {} then
		display notification "Select a message in Outlook before running the script!"
	else
		set messageId to id of item 1 of selectedMessages
		set messageSubject to the subject of item 1 of selectedMessages
		set uri to "outlook://" & messageId
		set the clipboard to "outlook://" & messageId
		display notification "outlook://" & messageId & " copied to clipboard"
	end if
end tell

I then created a script, triggered by ⌃⌥⌘-L, to copy the link to the currently-selected message to the clipboard, so I can paste it wherever I need it:

I also set up another macro, ⌃⌥⌘-O, that uses the above script to grab the link and opens the OmniFocus quick-entry window with the link already in the Notes field of the new task:

This is great when I need to create a task "Reply to Bob's questions about the Foo product" - when I click the link on the OmniFocus task, it opens the message I need to reply to. So much easier than trying to find it again!

Note that these links will only work on the same Mac where you created them - different Outlook instances will assign different message IDs, even if they're connected to the same account. You can move the message between folders etc though, and they'll still open fine.

I'm using Outlook for Mac v16.67 (I think that's the latest version). It has been working for a couple years though, so should be OK for slightly older versions too.

You're not, by any chance, still using "Old" Outlook are you? I think the latest version numbers are the same for Old and New, but New's AS support is rather broken.

Worth noting that id is an internal Outlook reference and that a message's id can change, eg if you re-index a mailbox. Not usually a problem, but shouldn't be relied on if your trying to do some kind of long-term reference.

I remember that Outlook had a "new interface" at some point - when I turned it on, there was a whole lot of functionality missing. I quickly turned it off again. I couldn't find any reference to that within the Outlook app last night though. So yeah, I'm probably on the latest version of the "old interface".

Agree, message IDs are not completely reliable (and not reliable at all across machines), but as far as I know that's the best we have for now :frowning:.

1 Like

bumping an old thread.

Did you need to update your apple script with the new interface? It is no longer working for me since I was forced into the new interface. Thanks in advance.

It's possible to get message ids for Outlook emails selected in the new interface ( through osascript – AppleScript or JS for Automation ), but I'm not sure MS provide, by default, a URL scheme that would make urls of the form outlook://1178 automatically clickable.

You could, in theory, define your own custom url scheme.

Another approach might be to create a file link to the underlying .eml file. You would then have to double-click that to open in in the email client.


FWIW the copying part might looks something like this, but I don't think URLs composed like this will work without installation of a url scheme to support them:

Copy IDs for selected emails in Outlook .kmmacros (2.7 KB)


Expand disclosure triangle to view JS source
const selections = Application("Outlook").selectedObjects();

return 0 < selections.length
    ? selections.map(
        x => `outlook://${x.id()}`
    )
    .join("\n")
    : "Nothing selected in Outlook";