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.
This commit is contained in:
parent
b5356dadb4
commit
9175fb721f
|
@ -593,13 +593,13 @@ applications and inserting them in org documents"
|
||||||
(org-add-link-type "mac-outlook" 'org-mac-outlook-message-open)
|
(org-add-link-type "mac-outlook" 'org-mac-outlook-message-open)
|
||||||
|
|
||||||
(defun org-mac-outlook-message-open (msgid)
|
(defun org-mac-outlook-message-open (msgid)
|
||||||
"Open a message in outlook"
|
"Open a message in Outlook"
|
||||||
(let* ((record-id-string (format "mdfind com_microsoft_outlook_recordID==%s" msgid))
|
(do-applescript
|
||||||
(found-message (replace-regexp-in-string "\n$" ""
|
(concat
|
||||||
(shell-command-to-string record-id-string))))
|
"tell application \"Microsoft Outlook\"\n"
|
||||||
(if (string= found-message "")
|
(format "open message id %s\n" (substring-no-properties msgid))
|
||||||
(message "org-mac-link: error could not find Outlook message %s" (substring-no-properties msgid))
|
"activate\n"
|
||||||
(shell-command (format "open \"`mdfind com_microsoft_outlook_recordID==%s`\"" msgid)))))
|
"end tell")))
|
||||||
|
|
||||||
(defun org-as-get-selected-outlook-mail ()
|
(defun org-as-get-selected-outlook-mail ()
|
||||||
"AppleScript to create links to selected messages in Microsoft Outlook.app."
|
"AppleScript to create links to selected messages in Microsoft Outlook.app."
|
||||||
|
|
Loading…
Reference in New Issue