Microsoft Outlook 2011 to Evernote (Early Draft)

Description

THIS SCRIPT HAS BEEN REPLACED!

Click here to go to the updated script page.

Old Version Notes

Here is a very early draft of a Microsoft Outlook 2011 to Evernote script -- thought I'd leave this code up in case someone wanted a very basic bit of code to look at. To use it, highlight the messages in Outlook that you want to export and run the script. Items will be imported directly into your default notebook.

The Code

(*
Veritrope.com
OUTLOOK 2011-TO-EVERNOTE
VERSION 0.5
November 8, 2010

~This is an early draft of an AppleScript to export Outlook items into Evernote.
Check back at http://veritrope.com/code for updates!
   
*)



tell application "Microsoft Outlook"
   
    -- GET MESSAGES
    set selectedMessages to current messages
   
    -- NO MESSAGE WARNING
    if selectedMessages is {} then
        display dialog "NO MESSAGES SELECTED." with icon 1
        return
    end if
   
    repeat with theMessage in selectedMessages
       
        -- GET OUTLOOK ITEM INFORMATION
        set theName to subject of theMessage
        set theCategory to category of theMessage
        set theContent to content of theMessage
        set theHTML to has html of theMessage
        set theID to id of theMessage as string
       
        --CREATE NOTE WITH EITHER HTML OR TEXT
        if theHTML is true then
            tell application "Evernote"
                set theNote to create note with html theContent title theName
            end tell
        else
            tell application "Evernote"
                set theNote to create note with text theContent title theName
            end tell
        end if
    end repeat
end tell

13 Responses to “Microsoft Outlook 2011 to Evernote (Early Draft)”

  1. Naima December 28, 2010 at 8:58 am #

    Works beautifully … thank you!

  2. Michael January 31, 2011 at 3:07 pm #

    Nice script, I added a bit at the end to open the new note so I can add any tags and additional notes.

    tell application "Evernote"
        open note window with theNote
    end tell
  3. Todd February 8, 2011 at 8:35 pm #

    Thanks so much for this! I extended it a little to copy the email Sent date to the note’s creation date, something like:

      set theTime to time sent of theMessage
      ...
      set theNote to create note with html theContent title theName created theTime

    I wanted to do the same thing for From-to-Author but Evernote doesn’t seem to expose a way to set a note’s author.

  4. John February 17, 2011 at 10:39 pm #

    Awesome script! It would be very useful to be able to include attachments when sending the outlook message to Evernote.

    • Justin Lancy February 17, 2011 at 10:42 pm #

      I agree — and I’m hoping that Microsoft releases the update that enables this soon!

      • kolz April 3, 2011 at 4:29 pm #

        intially put my response in wrong topic. Love the script. wondering about a couple of things.

        1.) Growl integration ? – I like that confirmation notice of success, too lazy to look in evernote

        2) if can’t do growl – then were do i put the Open the note up additions ?

        thankx

        • Justin Lancy April 7, 2011 at 12:33 pm #

          I’ll definitely add Growl when I do the next revision…. been waiting on Microsoft to fix some Outlook/AppleScript-related things before I spend anymore time on it. However SP1 is scheduled for release next week and, maybe if we’re lucky, it’ll make sense to move forward then!

          • Tim April 15, 2011 at 7:54 pm #

            I incorporated some of the ideas here, plus i added prefixing the sender’s name to the note title and added an “Email” tag to each note. Final script looked like this…

            tell application “Microsoft Outlook”
            set selectedMessages to current messages
            if selectedMessages is {} then
            display dialog “NO MESSAGES SELECTED.” with icon 1
            return
            end if

            repeat with theMessage in selectedMessages

            — GET OUTLOOK ITEM INFORMATION
            set theName to subject of theMessage
            set theSender to sender of theMessage
            set theCategory to category of theMessage
            set theContent to content of theMessage
            set theHTML to has html of theMessage
            set theID to id of theMessage as string
            set theTime to time sent of theMessage
            set theTitle to name of theSender & “: ” & theName

            –CREATE NOTE WITH EITHER HTML OR TEXT
            if theHTML is true then
            tell application “Evernote”
            set theNote to create note with html theContent title theTitle created theTime tags {“Email”}
            end tell
            else
            tell application “Evernote”
            set theNote to create note with text theContent title theTitle created theTime tags {“Email”}
            end tell
            end if
            end repeat
            end tell

          • Justin Lancy April 15, 2011 at 7:59 pm #

            Hey Tim,

            Thanks for this contribution!

            I’ve been working hard on this script myself and I am about to publish my own revision to the script — probably early next week… If you’re interested in being a “beta tester”, you can send me a note on Twitter or via the Veritrope.com Contact form!

          • Ian March 10, 2012 at 12:42 pm #

            Any plan to update this script? Perhaps to include attachments that are in the email messages as well?

          • Justin Lancy March 10, 2012 at 2:27 pm #

            Already did! You can find the updated version of the Outlook 2011 to Evernote AppleScript here.

          • Kolz March 11, 2012 at 12:36 pm #

            What attachments work? i haven’t had it successfully work with any (doc,pdf, xlsx)

          • Justin Lancy March 11, 2012 at 1:32 pm #

            There is now an updated script which handles attachments!