Microsoft Outlook 2011 to Evernote (Early Draft)

Shared By: Justin

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 says:

    Works beautifully … thank you!

  2. Michael says:

    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 says:

    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 says:

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

    • Justin says:

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

      • kolz says:

        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 says:

          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 says:

            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 says:

            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 says:

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

          • Kolz says:

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

          • Justin says:

            There is now an updated script which handles attachments!

rss Subscribe to Comments RSS Feed


You can use these tags in your comment: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>