From 706bd67e4cfa2242892ebdc8a06f8a44e9b9e006 Mon Sep 17 00:00:00 2001
From: Mike McLean <mike.mclean@pobox.com>
Date: Tue, 9 Jun 2015 16:09:35 -0400
Subject: [PATCH] org-mac-link.el: Reduce Outlook App confusion
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* org-mac-link.el (org-mac-outlook-message-open, org-as-get-selected-outlook-mail): Specify Microsoft Outlook.app non-ambiguously

If the user has:
- a virtual solution (Parallels, etc.)
- with Office for PC installed
- and configured to expose WinTel applications to the Macintosh Finder

The AppleScript commands may try to select the WinTel version of
"Microsoft Outlook". This—obviously—doesn’t work. By adding the Mac
~.app~ file extension and path, we reduce this confusion and more
reliably call the Macintosh version of Outlook.

TINYCHANGE
---
 contrib/lisp/org-mac-link.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/contrib/lisp/org-mac-link.el b/contrib/lisp/org-mac-link.el
index e0636a5..c991dfa 100644
--- a/contrib/lisp/org-mac-link.el
+++ b/contrib/lisp/org-mac-link.el
@@ -580,7 +580,7 @@ The links are of the form <link>::split::<name>."
   "Open a message in Outlook"
   (do-applescript
    (concat
-    "tell application \"Microsoft Outlook\"\n"
+    "tell application \"/Applications/Microsoft Office 2011/Microsoft Outlook.app\"\n"
     (format "open message id %s\n" (substring-no-properties msgid))
     "activate\n"
     "end tell")))
@@ -589,7 +589,7 @@ The links are of the form <link>::split::<name>."
   "AppleScript to create links to selected messages in Microsoft Outlook.app."
   (do-applescript
    (concat
-    "tell application \"Microsoft Outlook\"\n"
+    "tell application \"/Applications/Microsoft Office 2011/Microsoft Outlook.app\"\n"
     "set msgCount to count current messages\n"
     "if (msgCount < 1) then\n"
     "return\n"
-- 
2.4.3

