1 #+TITLE: Org Link -- create Org-mode hyperlinks to Entourage mail messages
2 #+OPTIONS: ^:{} author:nil
5 # This file is released by its authors and contributors under the GNU
6 # Free Documentation license v1.3 or later, code examples are released
7 # under the GNU General Public License v3 or later.
9 [[file:org-mac.org][{Back to Worg's Org and Mac OS X page}]]
13 This hack allows the user to easily copy and paste links to messages
14 from the Entourage mail app into an org-mode file.
15 * Installation & Setup
16 ** Create and Save Script In Entourage Scripts Menu Folder
18 Installation is simple. Create a new Applescript application using the following code:
20 : tell application "Microsoft Entourage"
21 : set selectedMessages to current messages
22 : if selectedMessages is {} then
25 : repeat with theMessage in selectedMessages
26 : set theName to subject of theMessage
27 : set theSender to display name of sender of theMessage
28 : set theContent to content of theMessage
29 : set theID to ID of theMessage as string
30 : set theCommand to "mdfind com_microsoft_entourage_recordID==" & theID & " | sed 's/ /\\%20/'"
31 : set theMDfile to the first item of paragraphs of (do shell script theCommand)
32 : set the clipboard to "[[file:" & theMDfile & "][" & theName & "]]" as string
36 and save it into your personal Entourage Scripts Menu Folder. It's
37 file path should be something like:
39 : ~/user/Documents/Microsoft User Data/Entourage Script Menu Items
41 You can also locate this folder by opening Entourage and selecting
42 the Applescript/Automator icon from the main toolbar (looks like a
43 scroll / on the far right). If you select "About This Menu..." and
44 click on the "Open Folder" dialog button it will open the
45 "Entourage Script Menu Items" folder in Finder.
47 The exact file name will be used as the menu option so if you want it to look pretty be sure and
48 use something like "Copy Org Link" as the file name.
50 Once you've completed this step you should be able to run the
51 script by selecting the "<file name>" option from the
52 Applescript/Automator icon drop menu.
53 ** Create Entourage Shortcut Key
55 After the first step you should already be able to use the script
56 (see usage below); however, it will probably be easier to use if
57 you assign it a hot key (like the cut and paste shortcut keys).
59 In order to assign it a hot key, open "System Preferences" and
60 navigate to the following location:
62 : Hardware/Keyboard & Mouse/Keyboard Shortcuts
64 Scroll to the bottom of the window, highlight "Application
65 Keyboard Shortcuts", and click the "+" sign just to the lower left
68 This should open a dialog box. Use the drop menu to select
69 "Entourage" as the application, then enter the exact name that
70 appears in the Entourage script menu. The default is
71 "copy-org-link". Then enter the exact key combination that you
72 would like to use as a shortcut in the "Keyboard Shortcut" window.
73 My default is "<command> l".
75 When you go back to the scripts menu in Entourage you should now
76 see the shortcut next to the name of the script.
77 ** Enable Entourage Message Indexing In Spotlight
79 In order for the hack to work the user must have enabled the
80 Entourage application preference that allows OS X's built-in
81 Spotlight search engine to index the contents of the Entourage
84 To enable this preference open Entourage and select the following
87 : Preferences/General Preferences/Spotlight/
89 Then, simply check the box next to "Include Entourage items in Spotlight search
90 results" to instruct Spotlight to index your messages.
92 If you haven't previously had this feature enabled it may take it a
93 few minutes to index your messages, but once it has finished you
94 should be able to run the script successfully.
96 NOTE: This step is required because of the way that Entourage
97 stores its messages (in a single monolithic database). When
98 Spotlight indexes the messages it creates separate files that can
99 be referenced and contain sufficient metadata to link back to the
100 original message in Entoura
103 Once the hack has been setup simply highlight a message line in the
104 message list window, hold down the <command> key, and press the
105 assigned key. This action will run the Applescript macro which will
106 copy a properly formatted link to the message onto the
107 clipboard. Simply paste the text from the clipboard into a .org
108 document to create the link.
110 Because of the way Spotlight indexes messages (it assigns each a
111 unique identifier that never changes) the link should still work no
112 matter where you move the original email within Entourage.