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