summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike McLean <mike.mclean@pobox.com>2013-10-13 09:04:59 -0400
committerCarsten Dominik <carsten.dominik@gmail.com>2013-10-13 20:23:37 +0200
commit9175fb721f3eb1a283777d14aabffa3300af7991 (patch)
treed8cead0c7c0c0e6175162a9dd9e7bb549ad9ecfd
parentb5356dadb4cf886e10203df7c977126d7cd4b7d8 (diff)
downloadorg-mode-9175fb721f3eb1a283777d14aabffa3300af7991.tar.gz
Org Mac Outlook opens messages via AppleScript
* org-mac-link.el (org-mac-outlook-message-open): Use Apple Script. Previously ~org-mac-outlook-message-open~ used the Mac OS X Spotlight index via ~mdfind~ to open messages via shell commands. This patch changes the open to an AppleScript method to resolve an issue reported by Manish Sharma.
-rw-r--r--contrib/lisp/org-mac-link.el14
1 files changed, 7 insertions, 7 deletions
diff --git a/contrib/lisp/org-mac-link.el b/contrib/lisp/org-mac-link.el
index 2ff6711..ebcff75 100644
--- a/contrib/lisp/org-mac-link.el
+++ b/contrib/lisp/org-mac-link.el
@@ -593,13 +593,13 @@ applications and inserting them in org documents"
(org-add-link-type "mac-outlook" 'org-mac-outlook-message-open)
(defun org-mac-outlook-message-open (msgid)
- "Open a message in outlook"
- (let* ((record-id-string (format "mdfind com_microsoft_outlook_recordID==%s" msgid))
- (found-message (replace-regexp-in-string "\n$" ""
- (shell-command-to-string record-id-string))))
- (if (string= found-message "")
- (message "org-mac-link: error could not find Outlook message %s" (substring-no-properties msgid))
- (shell-command (format "open \"`mdfind com_microsoft_outlook_recordID==%s`\"" msgid)))))
+ "Open a message in Outlook"
+ (do-applescript
+ (concat
+ "tell application \"Microsoft Outlook\"\n"
+ (format "open message id %s\n" (substring-no-properties msgid))
+ "activate\n"
+ "end tell")))
(defun org-as-get-selected-outlook-mail ()
"AppleScript to create links to selected messages in Microsoft Outlook.app."