Outlook 2011 To Evernote

Description

Alert – September 26, 2014:
Early reports suggest that the new Evernote 5.6 update may cause errors with AppleScript. If this script is critical to your workflow, you may want to hold off from upgrading.

A Brief Introduction

Mac users who have corporate IT people setting up their computers (or anyone who needs fuller Exchange support) often use Outlook 2011 (part of Microsoft's Office:mac 2011 package) as their email application. This free script lets you send items directly to Evernote with a keystroke and, if you like, even tag and sort them on the way in!

The script sends any type of Outlook item/items (messages, tasks, notes, calendar items, and contacts) to Evernote -- and even from highlighted text within an item. GROWL notifications give you status updates as things are added into Evernote.

Evernote Contact Links

Clickable Links Allow You To Map, Dial, and Email Faster!

"Does it handle attachments?", you ask. Yes -- they are also included in the Evernote item!

The script includes full HTML in the items whenever possible -- and I even took the time to make it so you'd have clickable links for contact information to help you quickly map addresses, call telephone numbers, etc. The note template is also fully customizable, allowing anyone with basic HTML knowledge to make their own layout. (I kept it pretty basic in this version)

Adding By Script Vs. Adding By Email

One fast way to get items into Evernote is simply to email them. Brett Kelly's eBook, "Evernote Essentials" provides a solid guide to how this works (See the chapter called "Evernote, Email and You") along with some other great email-related tips. So why not just forward items to your Evernote email address?

You certainly can do that -- but I think this approach is actually easier and also has a few additional benefits:

  • FASTER/SMARTER WORKFLOW. By following the special file-naming convention in the Microsoft Outlook Script Menu (see instructions below), you can use Keyboard Shortcuts that make it incredibly fast and easy to stay organized! Personally, I use ⌘E to quickly send anything to Evernote. I can also tag and direct multiple items to a notebook by using a simple, fast dialog box instead of having to email them in one at a time (Example - Outlook handles multiple emails being forwarded by attaching them as .eml files to a single email). Trust me -- Archiving whole folders goes much faster when you don't have to send an email for every item! But the script isn't just good for big, bulky moves: I can also send less than a whole item, quickly clipping only the bits of highlighted text I'm interested in.

  • BETTER USABILITY. Ever try to share Outlook contact information with people quickly? You can use Outlook's "Forward Contact Information" function, but that just puts a vCard into an email. Not everyone is able to read that information easily -- especially if they're working from their mobile phone. This script creates readable, rich text information in Evernote as well as attaching a vCard. You can email it, share it with larger groups using Evernote's Shared Notebooks, post a link to it -- whatever is the most useful to you! And by creating basic templates to display Contact and Calendar information, the information is searchable using Evernote's internal indexing... and accessible no matter where you are.

  • NO INTERNET NEEDED. Emailing an item into Evernote probably isn't an option if you have local, non-synchronized notebooks which contain sensitive information (or should you find yourself without an internet connection). This script moves things directly

Important Notes and Requirements

  • This AppleScript now Requires a minimum of Outlook 2011 SP1 (Version 14.1.0 or Greater) and OS X 10.9 "Mavericks".

  • Accordingly, I've removed the GROWL requirement. Let me know if you liked it better the old way.

INSTALLATION

  • On this page, click the link below "The Code" preview window which says "Click here to open it in your Script Editor". This will open the AppleScript inside your system's default AppleScript Editor application.
  • Save this script to ~/Documents/Microsoft User Data/Outlook Script Menu Items (Or Its Equivalent in Localized Language). You can navigate quickly to this folder by selecting Outlook's Script Menu => About This Menu... => Open Folder)
  • The Script Menu:



    ...and the "Open Folder" button:

  • Give it a filename that enables a keyboard shortcut to be used.
    Example: "Send to EvernotemE.scpt" lets you press ⌘E to send items to Evernote!
  • Take a moment to review the "User Switches" Configuration at the beginning of the script before saving it. You'll find the ability to change certain defaults, including turning on a dialog box which lets you tag and sort items on the way in!

Enjoy -- and don't forget...

Be sure to follow the Veritrope.com Twitter Feed for news about updates for this script (and many more!).

The Code

(*
Veritrope.com
OUTLOOK 2011 TO EVERNOTE
VERSION 1.07
May 31, 2014

// TERMS OF USE:
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.

// LIKE THIS SCRIPT?
If this AppleScript is helpful to you, please show your support here:
http://veritrope.com/support

// SCRIPT INFORMATION AND UPDATE PAGE
http://veritrope.com/code/outlook-2011-to-evernote

// REQUIREMENTS
• OS X 10.9 Mavericks and Above.
• Microsoft Outlook 2011 SP1 and above.

//CHANGELOG
1.07   Change to budle id to avoid conflicts with Outlook installed on Virtual Machines
1.06    Thanks to Steven Beebe, script notifications now updated to use Notification Center and there's a user switch to remove embedded image links.
1.05     Fix for leading spaces in tags
1.04     Fixes for Attachements, Tagging
1.03     Added TO: / CC: Information to Email Messages
1.02     Added Meeting Organizer information
1.01     Removed unused code, Additional Tweak to GROWL code, Added Meeting Attendees
1.00     Tweak to GROWL code

// RECOMMENDED INSTALLATION INSTRUCTIONS:
1.)  Save this script to ~/Documents/Microsoft User Data/Outlook Script Menu Items (Or Its Equivalent in Localized Language);

(You can navigate quickly to this folder by selecting: Outlook's Script Menu => About This Menu… => Open Folder)

2.)  Give it a filename that enables a keyboard shortcut to be used.
   
Example: "Send to Evernote\mE.scpt" lets you press ⌘E to send items to Evernote!

3.) Enjoy!
   
*)


(*
======================================
// USER SWITCHES
======================================
*)


--SET THIS TO "OFF" IF YOU WANT TO SKIP THE TAGGING/NOTEBOOK DIALOG
--AND SEND ITEMS DIRECTLY INTO YOUR DEFAULT NOTEBOOK
property tagging_Switch : "ON"

--IF YOU'VE DISABLED THE TAGGING/NOTEBOOK DIALOG,
--TYPE THE NAME OF THE NOTEBOOK YOU WANT TO SEND ITEM TO
--BETWEEN THE QUOTES IF IT ISN'T YOUR DEFAULT NOTEBOOK.
--(EMPTY SENDS TO DEFAULT)
property EVnotebook : ""

--IF TAGGING IS ON AND YOU'D LIKE TO CHANGE THE DEFAULT TAG,
--TYPE IT BETWEEN THE QUOTES (ITEM TYPE IS DEFAULT)
property defaultTag : ""

--SOME EMAILS USING THE SRC="CID:..." TAG FOR EMBEDDED IMAGES
--GENERATE A "There is no application set to open the URL cid:(filename)"
--ERROR WHEN SENDING TO EVERNOTE. SETTING THIS PROPERTY TO
--ON WILL STRIP OUT THOSE TAGS AND AVOID THE ERROR.
property stripEmbeddedImages : "OFF"
(*
======================================
// OTHER PROPERTIES
======================================
*)

property successCount : 0
property account_Type : "free"
property myTitle : "Item"
property theAttachments : ""
property thisMessage : ""
property itemNum : "0"
property attNum : "0"
property errNum : "0"
property userTag : ""
property EVTag : {}
property the_class : ""
property list_Props : {}
property SaveLoc : ""
property selectedItem : {}
property t_List : {}
property c_List : {}

(*
======================================
// MAIN PROGRAM
======================================
*)


--RESET ITEMS
set successCount to "0"
set AppleScript's text item delimiters to ""
set selectedItems to {}
set ExportFolder to ""
set SaveLoc to ""

--LET'S GO!
try
   
    --SET UP ACTIVITIES
    set selectedItems to my item_Check()
   
    --MESSAGES SELECTED?
    if selectedItems is not missing value then
       
        --GET FILE COUNT
        my item_Count(selectedItems, the_class)
       
        --ANNOUNCE THE EXPORT OF ITEMS
        my process_Items(itemNum, attNum)
       
        --CHECK EVERNOTE ACCOUNT TYPE
        my account_Check()
       
        --PROCESS ITEMS FOR EXPORT
        my item_Process(selectedItems)
       
        --DELETE TEMP FOLDER IF IT EXISTS
        set success to my trashfolder(SaveLoc)
       
        --NO ITEMS SELECTED
    else
        set successCount to -1
    end if
   
    --Notify RESULTS
    my notify_results(successCount)
   
   
    -- ERROR HANDLING
on error errText number errNum
   
    if errNum is -128 then
        set notifTitle to "Outlook to Evernote"
        set notifSubtitle to "Failure Notification"
        set notifMessage to "User Cancelled - Failed to export!"
    else
        set notifTitle to "Outlook to Evernote"
        set notifSubtitle to "Failure Notification"
        set notifMessage to "Import Failure - " & errText
    end if
   
    display notification notifMessage with title notifTitle subtitle notifSubtitle
   
end try

(*
======================================
// PREPARATORY SUBROUTINES
=======================================
*)


--CHECK ACCOUNT TYPE
on account_Check()
    tell application "Evernote"
        set account_Info to (properties of account info 1)
        set account_Type to (account type of account_Info) as text
        if EVnotebook is "" then set EVnotebook to my default_Notebook()
    end tell
end account_Check

--SET UP ACTIVITIES
on item_Check()
    --set myPath to (path to home folder)
    tell application id "com.microsoft.Outlook"
        try -- GET MESSAGES
            set selectedItems to selection
            set raw_Class to (class of selectedItems)
            if raw_Class is list then
                set classList to {}
                repeat with selectedItem in selectedItems
                    copy class of selectedItem to end of classList
                end repeat
                if classList contains task then
                    set the_class to "Task"
                else
                    set raw_Class to (class of item 1 of selectedItems)
                end if
            end if
            if raw_Class is calendar event then set the_class to "Calendar"
            if raw_Class is note then set the_class to "Note"
            if raw_Class is task then set the_class to "Task"
            if raw_Class is contact then set the_class to "Contact"
            if raw_Class is incoming message then set the_class to "Message"
            if raw_Class is text then set the_class to "Text"
            if defaultTag is "" then set defaultTag to the_class
        end try
        return selectedItems
    end tell
end item_Check

--GET COUNT OF ITEMS AND ATTACHMENTS
on item_Count(selectedItems)
    tell application id "com.microsoft.Outlook"
        if the_class is not "Text" then
            set itemNum to count of selectedItems
            set attNum to 0
            try
                repeat with selectedMessage in selectedItems
                    set attNum to attNum + (count of attachment of selectedMessage)
                end repeat
            end try
        else
            set itemNum to 1
        end if
    end tell
end item_Count

(*
======================================
// PROCESS OUTLOOK ITEMS SUBROUTINE
======================================
*)


on item_Process(selectedItems)
    tell application id "com.microsoft.Outlook"
       
        --TAGGING?
        if tagging_Switch is "ON" then my tagging_Dialog()
       
        --TEXT CLIPPING?
        if (class of selectedItems) is text then
            set EVTitle to "Text Clipping from Outlook"
            set theContent to selectedItems
            --CREATE IN EVERNOTE
            tell application "Evernote"
                set theNote to create note with text theContent title EVTitle notebook EVnotebook
                if EVTag is not {} then assign EVTag to theNote
            end tell
           
            --ITEM HAS FINISHED -- COUNT IT AS A SUCCESS!
            set successCount to 1
        else
            -- GET OUTLOOK ITEM INFORMATION
            repeat with selectedItem in selectedItems
                try
                    set theAttachments to attachments of selectedItem
                    set raw_Attendees to attendees of selectedItem
                end try
               
                try
                    set t_List to {}
                    set c_List to {}
                   
                    --LOOK FOR "TO: RECIPIENTS" AND MAKE LIST
                    set t_Recipients to (to recipients of selectedItem)
                    set t_Count to (count of t_Recipients)
                    set t_Mult to ", "
                    repeat with t_Recipient in t_Recipients
                        set t_Completed to false
                        if t_Count is 1 then set t_Mult to ""
                        set t_Address to (email address of t_Recipient)
                        try
                            set t_Name to (name of t_Address)
                            set t_List to t_List & {t_Name & " (" & (address of t_Address) & ")" & t_Mult} as string
                            set t_Completed to true
                        end try
                        if t_Completed is false then
                            set t_List to t_List & {(address of t_Address) & t_Mult} as string
                        end if
                        set t_Count to (t_Count - 1)
                    end repeat
                   
                   
                   
                    --LOOK FOR "CC: RECIPIENTS" AND MAKE LIST
                    set c_Recipients to (cc recipients of selectedItem)
                    set c_Count to (count of c_Recipients)
                    set c_Mult to ", "
                    repeat with c_Recipient in c_Recipients
                        set c_Completed to false
                        if c_Count is 1 then set c_Mult to ""
                        set c_Address to (email address of c_Recipient)
                        try
                            set c_Name to (name of c_Address)
                            set c_List to c_List & {c_Name & " (" & (address of c_Address) & ")" & c_Mult} as string
                            set c_Completed to true
                        end try
                        if c_Completed is false then
                            set c_List to c_List & {(address of c_Address) & c_Mult} as string
                        end if
                        set c_Count to (c_Count - 1)
                    end repeat
                   
                end try
               
                set selectedItem to (properties of selectedItem)
                set the_vCard to {}
                set the_notes to ""
               
                --WHAT KIND OF ITEM IS IT?
                if the_class is "Calendar" then
                   
                    (* // CALENDAR ITEM *)
                   
                    --PREPARE THE TEMPLATE 
                    --LEFT SIDE (FORM FIELDS)
                    set l_1 to "Event:"
                    set l_2 to "Start Time:"
                    set l_3 to "End Time:"
                    set l_4 to "Location:"
                    set l_5 to "Notes:"
                   
                    --RIGHT SIDE (DATA FIELDS)
                    set r_1 to (subject of selectedItem)
                    set r_2 to (start time of selectedItem)
                    set r_3 to (end time of selectedItem)
                    set the_Location to (location of selectedItem)
                    if the_Location is missing value then set the_Location to "None"
                    set r_4 to the_Location
                   
                    --THE NOTES
                    set the_notes to ""
                    set item_Created to (current date)
                    try
                        set the_notes to (content of selectedItem)
                    end try
                    if the_notes is missing value then set the_notes to ""
                   
                    --ADD ORGANIZER / ATTENDEE INFO IF IT'S A MEETING
                    if (count of raw_Attendees) > 0 then
                        set the_Organizer to "<strong>Organized By: </strong><br/>" & (organizer of selectedItem) & "<br/><br/>"
                        set the_Attendees to "<strong>Invited Attendees: </strong><br/>"
                        repeat with raw_Attendee in raw_Attendees
                           
                            --GET ATTENDEE DATA
                            set raw_EmailAttendee to (email address of raw_Attendee)
                            set attend_Name to (name of raw_EmailAttendee) as text
                            set raw_Status to (status of raw_Attendee)
                           
                            --COERCE STATUS TO TEXT
                            if raw_Status contains not responded then
                                set attend_Status to "Not Responded"
                            else if raw_Status contains accepted then
                                set attend_Status to "Accepted"
                            else if raw_Status contains declined then
                                set attend_Status to "Declined"
                            else if raw_Status contains tentatively accepted then
                                set attend_Status to "Tentatively Accepted"
                            end if
                           
                            --COMPILE THE ATTENDEE DATA
                            set attend_String to attend_Name & " (" & attend_Status & ")<br/>"
                            set the_Attendees to the_Attendees & attend_String
                        end repeat
                        set the_notes to (the_Organizer & the_Attendees & the_notes)
                        set raw_Attendees to ""
                    end if
                   
                    --ASSEMBLE THE TEMPLATE
                    set theContent to my make_Template(l_1, l_2, l_3, l_4, l_5, r_1, r_2, r_3, r_4, the_notes)
                   
                    --EXPORT VCARD DATA
                    try
                        set vcard_data to (icalendar data of selectedItem)
                        set vcard_extension to ".ics"
                        set the_vCard to my write_File(r_1, vcard_data, vcard_extension)
                    end try
                   
                    set theHTML to true
                    set EVTitle to r_1
                   
                    (* // NOTE ITEM *)
                else if the_class is "note" then
                   
                    --PREPARE THE TEMPLATE 
                    --LEFT SIDE (FORM FIELDS)
                    set l_1 to "Note:"
                    set l_2 to "Creation Date:"
                    set l_3 to "Category"
                    set l_4 to ""
                    set l_5 to "Notes:"
                   
                    --RIGHT SIDE (DATA FIELDS)
                    set r_1 to name of selectedItem
                    set item_Created to creation date of selectedItem
                    set r_2 to (item_Created as text)
                   
                    --GET CATEGORY INFO
                    set the_Cats to (category of selectedItem)
                    set list_Cats to {}
                    set count_Cat to (count of the_Cats)
                    repeat with the_Cat in the_Cats
                        set cat_Name to (name of the_Cat as text)
                        copy cat_Name to the end of list_Cats
                        if count_Cat > 1 then
                            copy ", " to the end of list_Cats
                            set count_Cat to (count_Cat - 1)
                        else
                            set count_Cat to (count_Cat - 1)
                        end if
                    end repeat
                   
                    set r_3 to list_Cats
                    set r_4 to ""
                   
                    set item_Created to creation date of selectedItem
                   
                    --THE NOTES
                    try
                        set the_notes to content of selectedItem
                    end try
                    if the_notes is missing value then set the_notes to ""
                   
                    --ASSEMBLE THE TEMPLATE
                    set theContent to my make_Template(l_1, l_2, l_3, l_4, l_5, r_1, r_2, r_3, r_4, the_notes)
                   
                    --EXPORT VCARD DATA
                    set vcard_data to (icalendar data of selectedItem)
                    set vcard_extension to ".ics"
                    set the_vCard to my write_File(r_1, vcard_data, vcard_extension)
                   
                    set theHTML to true
                    set EVTitle to r_1
                   
                    (* // CONTACT ITEM *)
                else if the_class is "contact" then
                   
                    --PREPARE THE TEMPLATE 
                    --LEFT SIDE (FORM FIELDS)
                    set l_1 to "Name:"
                    set l_2 to "Email:"
                    set l_3 to "Phone:"
                    set l_4 to "Address:"
                    set l_5 to "Notes:"
                   
                    --GET EMAIL INFO
                    try
                        set list_Addresses to {}
                        set email_Items to (email addresses of selectedItem)
                        repeat with email_Item in email_Items
                            set the_Type to (type of email_Item as text)
                            set addr_Item to (address of email_Item) & " (" & my TITLECASE(the_Type) & ")<br />" as text
                            copy addr_Item to the end of list_Addresses
                        end repeat
                    end try
                   
                    --GET PHONE INFO AND ENCODE TELEPHONE LINK
                    try
                        set list_Phone to {}
                        if business phone number of selectedItem is not missing value then
                            set b_Number to (business phone number of selectedItem)
                            set b_String to "<strong>Work: </strong><a href="tel:\" & b_Number & "">" & b_Number & "</a><br /><br />"
                            copy b_String to end of list_Phone
                        end if
                        if home phone number of selectedItem is not missing value then
                            set h_Number to (home phone number of selectedItem)
                            set h_String to "<p><strong>Home: </strong><a href="tel:\" & h_Number & "">" & h_Number & "<br /><br />"
                            copy h_String to end of list_Phone
                        end if
                        if mobile number of selectedItem is not missing value then
                            set m_Number to (mobile number of selectedItem)
                            set m_String to "<p><strong>Mobile: </strong><a href="tel:\" & m_Number & "">" & m_Number & "<br /><br />"
                            copy m_String to end of list_Phone
                        end if
                    end try
                   
                    --GET ADDRESS INFO
                    try
                        set list_Addr to {}
                       
                        (*BUSINESS *)
                        if business street address of selectedItem is not missing value then
                            set b_Str to (business street address of selectedItem)
                            set b_gStr to my encodedURL(b_Str)
                            if (business city of selectedItem) is not missing value then
                                set b_Cit to (business city of selectedItem)
                                set b_gCit to my encodedURL(b_Cit)
                            else
                                set b_Cit to ""
                                set b_gCit to ""
                            end if
                            if (business state of selectedItem) is not missing value then
                                set b_Sta to (business state of selectedItem)
                                set b_gSta to my encodedURL(b_Sta)
                            else
                                set b_Sta to ""
                                set b_gSta to ""
                            end if
                            if (business zip of selectedItem) is not missing value then
                                set b_Zip to (business zip of selectedItem)
                                set b_gZip to my encodedURL(b_Zip)
                            else
                                set b_Zip to ""
                                set b_gZip to ""
                            end if
                            if (business country of selectedItem) is not missing value then
                                set b_Cou to (business country of selectedItem)
                                set b_gCou to my encodedURL(b_Cou)
                            else
                                set b_Cou to ""
                                set b_gCou to ""
                            end if
                            set b_Addr to b_Str & "<br/>" & b_Cit & ", " & b_Sta & "  " & b_Zip & "<br/>" & b_Cou
                           
                            --GOOGLE MAPS LOCATION IN URL
                            set b_gString to b_gStr & "," & b_gCit & "," & b_gSta & "," & b_gZip & "," & b_gCou
                            set b_GMAP to "http://maps.google.com/maps?q=" & b_gString
                            set b_String to "<strong>Work: </strong><br /><a href="" & b_GMAP & "">" & b_Addr & "</a><br /><br />"
                            copy b_String to end of list_Addr
                        end if
                       
                        (*HOME *)
                        if home street address of selectedItem is not missing value then
                            set h_Str to (home street address of selectedItem)
                            set h_gStr to my encodedURL(h_Str)
                            if (home city of selectedItem) is not missing value then
                                set h_Cit to (home city of selectedItem)
                                set h_gCit to my encodedURL(h_Cit)
                            else
                                set h_Cit to ""
                                set h_gCit to ""
                            end if
                            if (home state of selectedItem) is not missing value then
                                set h_Sta to (home state of selectedItem)
                                set h_gSta to my encodedURL(h_Sta)
                            else
                                set h_Sta to ""
                                set h_gSta to ""
                            end if
                            if (home zip of selectedItem) is not missing value then
                                set h_Zip to (home zip of selectedItem)
                                set h_gZip to my encodedURL(h_Zip)
                            else
                                set h_Zip to ""
                                set h_gZip to ""
                            end if
                            if (home country of selectedItem) is not missing value then
                                set h_Cou to (home country of selectedItem)
                                set h_gCou to my encodedURL(h_Cou)
                            else
                                set h_Cou to ""
                                set h_gCou to ""
                            end if
                            set h_Addr to h_Str & "<br/>" & h_Cit & ", " & h_Sta & "  " & h_Zip & "<br/>" & h_Cou
                           
                            --GOOGLE MAPS LOCATION IN URL
                            set h_gString to h_gStr & "," & h_gCit & "," & h_gSta & "," & h_gZip & "," & h_gCou
                            set h_GMAP to "http://maps.google.com/maps?q=" & h_gString
                            set h_String to "<strong>Home: </strong><br /><a href="" & h_GMAP & "">" & h_Addr & "</a><br />"
                            copy h_String to end of list_Addr
                        end if
                    end try
                   
                    --RIGHT SIDE (DATA FIELDS)
                    set r_1 to (display name of selectedItem)
                    set r_2 to (list_Addresses as string)
                    set r_3 to (list_Phone as text)
                    set r_4 to (list_Addr as text)
                   
                    --EXPORT VCARD DATA
                    set vcard_data to (vcard data of selectedItem)
                    set vcard_extension to ".vcf"
                    set item_Created to (current date)
                   
                    --THE NOTES
                    try
                        set the_notes to plain text note of selectedItem
                        if the_notes is missing value then set the_notes to ""
                    end try
                   
                    --ASSEMBLE THE TEMPLATE
                    set theContent to my make_Template(l_1, l_2, l_3, l_4, l_5, r_1, r_2, r_3, r_4, the_notes)
                    set the_vCard to my write_File(r_1, vcard_data, vcard_extension)
                   
                    set theHTML to true
                    set EVTitle to r_1
                   
                    (* // TASK ITEM *)
                else if the_class is "task" then
                   
                    --PREPARE THE TEMPLATE 
                    --LEFT SIDE (FORM FIELDS)
                    set l_1 to "Note:"
                    set l_2 to "Priority:"
                    set l_3 to "Due Date:"
                    set l_4 to "Status:"
                    set l_5 to "Notes:"
                   
                    --RIGHT SIDE (DATA FIELDS)
                    set propClass to (class of selectedItem) as text
                    if propClass is "incoming message" then
                        set r_1 to (subject of selectedItem)
                    else
                        set r_1 to (name of selectedItem)
                    end if
                    set the_Priority to (priority of selectedItem)
                    if the_Priority is priority normal then set r_2 to "Normal"
                    if the_Priority is priority high then set r_2 to "High"
                    if the_Priority is priority low then set r_2 to "Low"
                   
                    set r_3 to (due date of selectedItem)
                    set item_Created to (current date)
                   
                    --TODO?
                    try
                        set todo_Flag to (todo flag of selectedItem) as text
                        set r_4 to my TITLECASE(todo_Flag)
                    end try
                   
                    --THE NOTES
                    try
                        if content of selectedItem is missing value then
                            set the_notes to plain text content of selectedItem
                        else
                            set the_notes to content of selectedItem
                        end if
                       
                    end try
                    if the_notes is missing value then set the_notes to ""
                   
                    --ASSEMBLE THE TEMPLATE
                    set theContent to my make_Template(l_1, l_2, l_3, l_4, l_5, r_1, r_2, r_3, r_4, the_notes)
                   
                    --EXPORT VCARD DATA
                    if propClass is not "incoming message" then
                        set vcard_extension to ".ics"
                        set vcard_data to (icalendar data of selectedItem)
                        set the_vCard to my write_File(r_1, vcard_data, vcard_extension)
                    end if
                   
                    set theHTML to true
                    set EVTitle to r_1
                   
                    (* // MESSAGE ITEM *)
                else
                    --PREPARE THE TEMPLATE 
                    --LEFT SIDE (FORM FIELDS)
                    set l_1 to "From: / To: / CC: "
                    set l_2 to "Subject:"
                    set l_3 to "Date:"
                    set l_4 to "Category:"
                    set l_5 to "Email Contents:"
                   
                    --GET EMAIL INFO
                    set the_Sender to (sender of selectedItem)
                    set s_Name to (address of the_Sender)
                    set s_Address to (address of the_Sender)
                   
                    --REPLACE WITH NAME, IF AVAILABLE
                    try
                        set s_Name to (name of the_Sender)
                    end try
                   
                    set sender_Link to "<a href="mailto:" & s_Address & "">" & s_Name & " (" & s_Address & ")</a>"
                   
                    --GET CATEGORY INFO
                    set the_Cats to (category of selectedItem)
                    set list_Cats to {}
                    set count_Cat to (count of the_Cats)
                    repeat with the_Cat in the_Cats
                        set cat_Name to (name of the_Cat as text)
                        copy cat_Name to the end of list_Cats
                        if count_Cat > 1 then
                            copy ", " to the end of list_Cats
                            set count_Cat to (count_Cat - 1)
                        else
                            set count_Cat to (count_Cat - 1)
                        end if
                    end repeat
                   
                    --RIGHT SIDE (DATA FIELDS)
                    set r_1 to "From: " & sender_Link & "<hr/>To: " & t_List & "<hr/>CC: " & c_List
                   
                    set m_Sub to (subject of selectedItem)
                    if m_Sub is missing value then
                        set r_2 to "<No Subject>"
                    else
                        set r_2 to {subject of selectedItem}
                    end if
                    set r_3 to (time sent of selectedItem)
                    set r_4 to list_Cats
                   
                    set theID to id of selectedItem as string
                    set item_Created to r_3
                    set EVTitle to r_2
                   
                    --PROCESS EMAIL CONTENT
                    set m_Content to content of selectedItem
                    set theHTML to has html of selectedItem
                    --set m_Content to plain text content of selectedItem
                    --set theHTML to false
                   
                   
                    --IF PLAINTEXT EMAIL CONTENT…
                    if theHTML is false then
                        set theContent to "Name: " & s_Name & return & "Subject: " & r_2 & return & "Sent: " & r_3 & return & return & return & return & m_Content
                        --IF HTML EMAIL CONTENT…
                    else
                        set the_notes to m_Content
                        --ASSEMBLE THE TEMPLATE
                        set theContent to my make_Template(l_1, l_2, l_3, l_4, l_5, r_1, r_2, r_3, r_4, the_notes)
                       
                        if stripEmbeddedImages is "ON" then
                            --REMOVE ANY EMBEDDED IMAGE RERENCES
                            set theContent to my stripCID(theContent)
                        end if
                    end if
                end if
               
                --CREATE NOTE IN EVERNOTE (FINALLY!)
                if theHTML is true then
                    tell application "Evernote"
                        set theNote to create note with html theContent title EVTitle notebook EVnotebook
                        if EVTag is not {} then assign EVTag to theNote
                        set creation date of theNote to item_Created
                       
                        --ATTACH VCARD (IF PRESENT)
                        if the_vCard is not {} then tell theNote to append attachment file the_vCard
                    end tell
                else
                    tell application "Evernote"
                        set theNote to create note with text theContent title EVTitle notebook EVnotebook
                        if EVTag is not {} then assign EVTag to theNote
                        set creation date of theNote to item_Created
                       
                        --ATTACH VCARD (IF PRESENT)
                        if the_vCard is not {} then tell theNote to append attachment file the_vCard
                    end tell
                end if
               
                --IF ATTACHMENTS PRESENT, RUN ATTACHMENT SUBROUTINE
                if theAttachments is not {} then my message_Attach(theAttachments, selectedItem, theNote)
               
                --ITEM HAS FINISHED! COUNT IT AS A SUCCESS AND RESET ATTACHMENTS!
                set successCount to successCount + 1
                set theAttachments to {}
            end repeat
        end if
    end tell
end item_Process


(*
======================================
// UTILITY SUBROUTINES
======================================
*)

--URL ENCODE
on encodedURL(the_Word)
    set scpt to "php -r 'echo urlencode("" & the_Word & "");'"
    return do shell script scpt
end encodedURL

--TITLECASE
on TITLECASE(txt)
    return do shell script "python -c "import sys; print unicode(sys.argv[1], 'utf8').title().encode('utf8')" " & quoted form of txt
end TITLECASE

--SORT SUBROUTINE
on simple_sort(my_list)
    set the index_list to {}
    set the sorted_list to {}
    repeat (the number of items in my_list) times
        set the low_item to ""
        repeat with i from 1 to (number of items in my_list)
            if i is not in the index_list then
                set this_item to item i of my_list as text
                if the low_item is "" then
                    set the low_item to this_item
                    set the low_item_index to i
                else if this_item comes before the low_item then
                    set the low_item to this_item
                    set the low_item_index to i
                end if
            end if
        end repeat
        set the end of sorted_list to the low_item
        set the end of the index_list to the low_item_index
    end repeat
    return the sorted_list
end simple_sort

--REPLACE
on replaceString(theString, theOriginalString, theNewString)
    set theNum to 0
    set {od, AppleScript's text item delimiters} to {AppleScript's text item delimiters, theOriginalString}
    set theStringParts to text items of theString
    if (count of theStringParts) is greater than 1 then
        set theString to text item 1 of theStringParts as string
        repeat with eachPart in items 2 thru -1 of theStringParts
            set theString to theString & theNewString & eachPart as string
            set theNum to theNum + 1
        end repeat
    end if
    set AppleScript's text item delimiters to od
    return theString
end replaceString

--REMOVE EMBEDDED IMAGE REFERENCES
on stripCID(theContent)
    set theCommandString to "echo " & quoted form of theContent & " | sed 's/"cid:.*"/""/'"
    set theResult to do shell script theCommandString
    return theResult
end stripCID

(*
======================================
// TAGGING SUBROUTINES
======================================
*)


--TAGGING AND NOTEBOOK SELECTION DIALOG
on tagging_Dialog()
    display dialog "Enter The Tag or Tags Below." & return & ¬
        "(NOTE: Multiple Tags Should Be Separated By Commas)" with title "Outlook to Evernote Export" default answer defaultTag ¬
        buttons {"Create in Default Notebook", "Select Notebook from List", "Cancel"} ¬
        default button "Create in Default Notebook" cancel button ¬
        "Cancel" with icon path to resource "Evernote.icns" in bundle (path to application "Evernote")
    set dialogresult to the result
    set userInput to text returned of dialogresult
    set ButtonSel to button returned of dialogresult
    set theDelims to {","}
    set userTag to my Tag_List(userInput, theDelims)
   
    --RESET, FINAL CHECK, AND FORMATTING OF TAGS
    set EVTag to {}
    set EVTag to my Tag_Check(userTag)
    if ButtonSel is "Select Notebook from List" then set EVnotebook to my Notebook_List()
end tagging_Dialog

--TAG SELECTION SUBROUTINE
on Tag_List(userInput, theDelims)
    set oldDelims to AppleScript's text item delimiters
    set theList to {userInput}
    repeat with aDelim in theDelims
        set AppleScript's text item delimiters to aDelim
        set newList to {}
        repeat with anItem in theList
            set newList to newList & text items of anItem
        end repeat
        set theList to newList
    end repeat
    set AppleScript's text item delimiters to oldDelims
    return theList
end Tag_List

--CREATES TAGS IF THEY DON'T EXIST
on Tag_Check(theTags)
    tell application "Evernote"
        set finalTags to {}
        repeat with theTag in theTags
           
            -- TRIM LEADING SPACE, IF ANY
            if (the character 1 of theTag is " ") then set theTag to text 2 thru end of theTag as text
           
            if (not (tag named theTag exists)) then
                try
                    set makeTag to make tag with properties {name:theTag}
                    set end of finalTags to makeTag
                end try
            else
                set end of finalTags to tag theTag
            end if
        end repeat
    end tell
    return finalTags
end Tag_Check

(*
======================================
// NOTEBOOK SUBROUTINES
======================================
*)


--GET EVERNOTE'S DEFAULT NOTEBOOK
on default_Notebook()
    tell application "Evernote"
        set get_defaultNotebook to every notebook whose default is true
        if EVnotebook is "" then
            set EVnotebook to name of (item 1 of get_defaultNotebook) as text
        end if
    end tell
end default_Notebook

--EVERNOTE NOTEBOOK SELECTION SUBROUTINE
on Notebook_List()
    tell application "Evernote"
        activate
        set listOfNotebooks to {} (*PREPARE TO GET EVERNOTE'S LIST OF NOTEBOOKS *)
        set EVNotebooks to every notebook (*GET THE NOTEBOOK LIST *)
        repeat with currentNotebook in EVNotebooks
            set currentNotebookName to (the name of currentNotebook)
            copy currentNotebookName to the end of listOfNotebooks
        end repeat
        set Folders_sorted to my simple_sort(listOfNotebooks) (*SORT THE LIST *)
        set SelNotebook to choose from list of Folders_sorted with title "Select Evernote Notebook" with prompt ¬
            "Current Evernote Notebooks" OK button name "OK" cancel button name "New Notebook" (*USER SELECTION FROM NOTEBOOK LIST *)
        if (SelNotebook is false) then (*CREATE NEW NOTEBOOK OPTION *)
            set userInput to ¬
                text returned of (display dialog "Enter New Notebook Name:" default answer "")
            set EVnotebook to userInput
        else
            set EVnotebook to item 1 of SelNotebook
        end if
    end tell
end Notebook_List

(*
======================================
// ATTACHMENT SUBROUTINES
=======================================
*)


--CLEAN TITLE FOR FILENAME
on clean_Title(rawFileName)
    set previousDelimiter to AppleScript's text item delimiters
    set potentialName to rawFileName
    set legalName to {}
    set illegalCharacters to {".", ",", "/", ":", "[", "]"}
    repeat with thisCharacter in the characters of potentialName
        set thisCharacter to thisCharacter as text
        if thisCharacter is not in illegalCharacters then
            set the end of legalName to thisCharacter
        else
            set the end of legalName to "_"
        end if
    end repeat
    return legalName
end clean_Title

--WRITE THE FILE
on write_File(r_1, vcard_data, vcard_extension)
    set ExportFolder to ((path to desktop folder) & "Temp Export From Outlook:") as string
    set SaveLoc to my f_exists(ExportFolder)
    set FileName to (my clean_Title(r_1) & vcard_extension)
    set theFileName to (ExportFolder & FileName)
    try
        open for access file theFileName with write permission
        write vcard_data to file theFileName as string
        close access file theFileName
        return theFileName
       
    on error errorMessage
        log errorMessage
        try
            close access file theFileName
        end try
    end try
end write_File

--FOLDER EXISTS
on f_exists(ExportFolder)
    try
        set myPath to (path to home folder)
        get ExportFolder as alias
        set SaveLoc to ExportFolder
    on error
        tell application "Finder" to make new folder with properties {name:"Temp Export From Outlook"}
    end try
end f_exists

--ATTACHMENT PROCESSING
on message_Attach(theAttachments, selectedItem, theNote)
   
    tell application id "com.microsoft.Outlook"
        --MAKE SURE TEXT ITEM DELIMITERS ARE DEFAULT
        set AppleScript's text item delimiters to ""
       
        --TEMP FILES PROCESSED ON THE DESKTOP
        set ExportFolder to ((path to desktop folder) & "Temp Export From Outlook:") as string
        set SaveLoc to my f_exists(ExportFolder)
       
        --PROCESS THE ATTCHMENTS
        set attCount to 0
        repeat with theAttachment in theAttachments
           
            set theFileName to ExportFolder & theAttachment's name
            try
                save theAttachment in file theFileName
            end try
            tell application "Evernote"
                tell theNote to append attachment file theFileName
            end tell
           
            --SILENT DELETE OF TEMP FILE
            set trash_Folder to path to trash folder from user domain
            do shell script "mv " & quoted form of POSIX path of theFileName & space & quoted form of POSIX path of trash_Folder
           
        end repeat
    end tell
   
end message_Attach

--SILENT DELETE OF TEMP FOLDER (THANKS MARTIN MICHEL!)
on trashfolder(SaveLoc)
    try
        set trashfolderpath to ((path to trash) as Unicode text)
        set srcfolderinfo to info for (SaveLoc as alias)
        set srcfoldername to name of srcfolderinfo
        set SaveLoc to (SaveLoc as alias)
        set SaveLoc to (quoted form of POSIX path of SaveLoc)
        set counter to 0
        repeat
            if counter is equal to 0 then
                set destfolderpath to trashfolderpath & srcfoldername & ":"
            else
                set destfolderpath to trashfolderpath & srcfoldername & " " & counter & ":"
            end if
            try
                set destfolderalias to destfolderpath as alias
            on error
                exit repeat
            end try
            set counter to counter + 1
        end repeat
        set destfolderpath to quoted form of POSIX path of destfolderpath
        set command to "ditto " & SaveLoc & space & destfolderpath
        do shell script command
        -- this won't be executed if the ditto command errors
        set command to "rm -r " & SaveLoc
        do shell script command
        return true
    on error
        return false
    end try
end trashfolder

(*
======================================
// NOTIFICATION SUBROUTINES
======================================
*)


--ANNOUNCE THE COUNT OF TOTAL ITEMS TO EXPORT
on process_Items(itemNum, attNum)
   
    set attPlural to "s"
   
    if attNum = 0 then
        set attNum to "No"
    else if attNum is 1 then
        set attPlural to ""
    end if
   
    set notifTitle to "Import to Evernote"
    set notifSubtitle to "Started - Processing " & itemNum & " " & " Item(s)"
    set notifText to "Including " & attNum & " Attachment" & attPlural
   
    display notification notifText with title notifTitle subtitle notifSubtitle
   
end process_Items

--NOTIFY RESULTS
on notify_results(successCount)
    if EVnotebook is "" then set EVnotebook to "Default"
   
    set notifTitle to ""
    set notifSubtitle to ""
    set notifMessage to ""
   
    set Plural_Test to (successCount) as number
   
    if Plural_Test is -1 then
        set notifTitle to "Outlook to Evernote"
        set notifSubtitle to "Failure Notification"
        set notifMessage to "Import failure - No Items Selected in Outlook!"
       
    else if Plural_Test is 0 then
        set notifTitle to "Outlook to Evernote"
        set notifSubtitle to "Failure Notification"
        set notifMessage to "No Items Exported From Outlook!"
       
    else
        set notifTitle to "Outlook to Evernote"
        set notifSubtitle to "Success Notification"
        set notifMessage to "Exported " & itemNum & " item(s) to " & EVnotebook & " notebook"
       
    end if
   
    display notification notifMessage with title notifTitle subtitle notifSubtitle
   
    set itemNum to "0"
    set EVnotebook to ""
   
end notify_results

(*
======================================
// TEMPLATE SUBROUTINES
======================================
*)

on make_Template(l_1, l_2, l_3, l_4, l_5, r_1, r_2, r_3, r_4, the_notes)
    --MAKE TASK TEMPLATE
    set the_Template to "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><meta http-equiv="
Content-Type" content="text/html; charset=UTF-8"/></head><body><table BGCOLOR="#bbbbbb" width="100%" cellspacing="1" cellpadding="1" style="border: 1px solid #bbbbbb">
<tbody>
<tr BGCOLOR="
#ffffff">
<td align="
center" ><font color="#424242"><h4><strong>  " & l_1 & "</strong></h4>  </td>
<td align="
center"  ><h4>" & r_1 & "</h4></td>
</tr>

<tr BGCOLOR="
#ffffff">
<td align="
center" ><font color="#424242"><h4><strong>  " & l_2 & "</strong></h4>  </td>
<td align="
center" ><h4><strong>" & r_2 & "</strong></h4></td>
</tr>

<tr BGCOLOR="
#ffffff">
<td align="
center" ><font color="#424242"><h4><strong>  " & l_3 & "</strong></h4></td>
<td align="
center" ><h4>" & r_3 & "</h4></td>
</tr>

<tr BGCOLOR="
#ffffff">
<td align="
center" ><font color="#424242"><h4><strong>  " & l_4 & "</strong></h4></td>
<td align="
center" ><h4> " & r_4 & "</h4></td>
</tr>
</tbody>
</table>
<hr />
<table border="
1" width="100%" cellspacing="10" cellpadding="10">
<tbody>
<strong>"
& l_5 & "</strong><br /><br />" & the_notes & "</tbody></table></body></html>"
end make_Template

150 Responses to “Outlook 2011 To Evernote”

  1. GrantC June 13, 2011 at 6:14 pm #

    Hi,

    Thanks for the script, very useful. Have noticed that even though I set the user defined notebook, emails where still getting sent to my default notebook. Think it’s the set notebook =”” in the Growl Results procedure that causes the problem.

    Also, I get an “attachement parameter file does not exist” when sending an email which has another email as an attachment (and that email had a CSV file attached), not sure what caused the problem though.

    Keep up the good work.

    • Justin Lancy June 13, 2011 at 6:27 pm #

      Grant — Thanks for the kind comments!

      I’m currently testing a different approach to Growl with some other scripts and, once I develop confidence that it’s solid, I intend to merge it into this one. When I do, I’ll see about this notebook issue as well.

      As far as the “attachment parameter error”, the Veritrope Bug Report Form allows you to upload files for me to look at — in this case, you can attach the problem email and I’ll use it to test future revisions.

      • Alex February 13, 2013 at 7:53 pm #

        Hello. I am trying to find an app that will allow me in one go to move my 300 notes from Outlook 2011 (Mac edition) to my Evernote account. I don’t want to synchronize between outlook and evernote, simply to move them over (ex blackberry user moving to android). I am very willing to make a generous donation if your app does this and you can assist me.
        Many thanks.

        • Justin Lancy February 13, 2013 at 7:59 pm #

          Give it a try— And definitely feel free to donate if it works for you! 😉

  2. Hans July 13, 2011 at 11:52 am #

    Great script, thanks,

    How do I modify the scripts so that I can change the title, i.e. add another text field in the dialog box with the email subject pre-populated? I find that I quite often change the title to make it easier to search on or to add work notes.

    Cheers,

    • Justin Lancy July 30, 2011 at 3:22 pm #

      I haven’t tested this, but you could add code like this right before Evernote creates the new item:

      display dialog "Set The Note Title" default answer EVTitle
      set dialogresult to the result
      set EVTitle to text returned of dialogresult

      FYI — I can be hired to customize scripts if you get into a jam!

      • Scott January 7, 2014 at 1:02 pm #

        This has been great, thanks! Has anyone successfully implemented this additional script? Can you show exactly where it was added? Thanks!

  3. Floyd July 30, 2011 at 1:51 pm #

    Wow! What a great script! Looks like you did a lot of great work — thanks for this.

    I was wondering if there’s a way to add the “to” and “cc” to the header list. That way, I can search on stuff where a friend also received the message.

    Regards to your great skill,

    – Floyd –

    • Justin Lancy July 30, 2011 at 3:13 pm #

      Floyd,

      Thanks for the kind comments and for your donation. These scripts really do take a lot of work and it means a lot to me when people recognize the amount of time and effort that go into it.

      I’ve emailed you a modified copy that adds the To: and CC: information — hope you enjoy it!

  4. Sandy October 2, 2011 at 8:11 pm #

    how do i actually download the script? is there a file?

    • Justin Lancy October 2, 2011 at 8:26 pm #

      Hi Sandy — There is a button below the code that says “Want to open the script right away? Click here to open it in your Script Editor”. It should open up the script in the AppleScript Editor and, from there, you can save it wherever you like!

      • Sandy October 2, 2011 at 8:30 pm #

        ok i was save the script, but when i click the email to export, it just sends text of some link, or something else. doesn’t actually copy the note over.

        • Justin Lancy October 2, 2011 at 8:39 pm #

          Hi Sandy,

          Have you:

          1. Saved this script to ~/Documents/Microsoft User Data/Outlook Script Menu Items?
          2. Saved it with a file name like“Send to EvernotemE.scpt” which lets you press ⌘E to send items to Evernote?
          3. Highlighted the message and then triggered the script with the keyboard shortcut?

          If that doesn’t get you working, let me know and we’ll go from there!

        • Sandy October 2, 2011 at 8:39 pm #

          ok, when i click on the script icon in Outlook, it will actually move the email over. I saved the file the same way you did, and for some reason i get error when i try the shortcut…any suggestions?

          • Justin Lancy October 2, 2011 at 9:03 pm #

            Sounds like maybe you should try saving it with a different shortcut and retrying… you can follow these instructions to select a different shortcut for the script.

  5. Steve Nunez October 16, 2011 at 7:21 pm #

    Just tried this script, but it doesn’t compile in the AppleScript editor on Lion. The error is a syntax error: “Expected “given”, “into”, “with”, “without”, other parameter name, etc. but found “””.”

    • Justin Lancy October 16, 2011 at 8:31 pm #

      This is a common error in versions of Outlook 2011 < 14.1.0…

      I am running Lion 10.7.2 / Outlook 14.1.2 / and Evernote 3.03b2 — script is still working for me!

      • Steve Nunez October 16, 2011 at 9:05 pm #

        Lion 10.7.2 / Outlook 14.1.3 / Evernote 3.0.2 — and still broken.

        • Justin Lancy October 16, 2011 at 9:42 pm #

          Looks like *I* am the one who needs the Outlook update! 😉

          Speaking of updates, I’m wondering if this has to do with the latest GROWL 1.3 update that just came out… Is this the version you’re running? If so, try doing a Find-and Replace for “GrowlHelperApp” in the script — changing it to “Growl”.

          Does the script compile now?

          • Steve Nunez October 16, 2011 at 9:54 pm #

            Possibly. I’m not running Growl at all, and one of the Outlook -> Omnifocus scripts broke because of that (despite having a flag for Growl support or not).

          • Justin Lancy October 16, 2011 at 10:07 pm #

            My guess is a lack of GROWL.

            Doing GROWL notifications via AppleScript is great — especially when you’re doing a “Bulk” send of a lot of stuff in the background. The problem is that AppleScript is really fussy about when people *don’t* have it. You can check out this excellent post by Dan Byler to see what a pain it’s been to deal with. The new version has a new way of doing things, and so many of us in the AppleScript community are still trying to sort out what this means for our existing scripts. Stay tuned on that….

            If you’re not opposed to GROWL, probably the easiest fix here is to install it. The new version is available at the App Store, but the older, free version is also still available as of this moment.

            Hope this helps!

          • Justin Lancy October 17, 2011 at 12:21 pm #

            Follow up on Steve’s issue — it *was* a lack of GROWL.

  6. Lars October 17, 2011 at 11:57 am #

    Hi, thanks for that tool, i find it very usefull.

    Exporting Emails works fine, tasks as well, but I have a problem with the contact data.

    trying to export my outlook contacts i get a “failed to export”, every attachment of item 1 of contact id 163 couldn’t be read… didn’t manage to export a contact yet.

    do you have any advise on that?

    Thanks a lot, Lars

    • Justin Lancy October 17, 2011 at 12:20 pm #

      Hi Lars,

      I was able to reproduce this error and I just updated the code to Version 0.99 (see above) with what I hope is a fix…

      Working for you now?

      • Lars October 18, 2011 at 4:23 am #

        Hi Justin, awesome. Many thanks, it works fine now. Great, I was looking so long for way to get my outlook contacts into Evernote.

        Thanks again. Lars

        • Justin Lancy October 18, 2011 at 11:28 am #

          Glad to hear it — and thanks for your donation supporting Veritrope.com! 😀

  7. Thomas January 17, 2012 at 1:17 pm #

    I love this script – excellently done!

    • Justin Lancy January 17, 2012 at 1:35 pm #

      Thanks Thomas — Your support is appreciated!

  8. Sandy January 18, 2012 at 3:20 pm #

    i noticed that you updated the script. I tried to save it and it keeps giving me “syntax error”. Help?

    • Justin Lancy January 18, 2012 at 4:19 pm #

      Hi Sandy,

      Responded via email with some troubleshooting tips.

      -Justin

  9. Bard Papegaaij January 19, 2012 at 7:33 pm #

    Hi,

    After updating my Outlook to 14.1.0 everything works like clockwork! Excellent!

    I have made a (modest but well-meant) donation and urge everyone to do the same: efforts like this should be rewarded.

    Warm regards,

    Bard

  10. Jim January 20, 2012 at 10:46 am #

    MacOS 10.7.2
    Outlook 14.1.4
    Growl 1.2.2
    Send to Evernote VERSION 0.99 (Beta 3)

    As soon as download to Applescript Editor get error Syntax Error “Expected “given”, “into”, “with”, “without”, other parameter name, etc. but found “””.”

    Saved the .scpt file to the outlook script directory anyway. Does not show in the AppleScripts for Outlook pulldown – when I open the folder, the scpt file is there. Presume above syntax error, which prevents it from compiling, is a show stopper?

    Any assistance appreciated.
    Cheers, Jim

  11. Ed February 3, 2012 at 10:43 am #

    Awesome! This solves a very real problem I am having in trying to replicate the meeting notes capabilities of onenote.

    Would it be difficult to send the same information to an outlook note? And, is there a way to file that outlook note in my email directory without having to email it to myself?

    Thanks.

    -Ed

    • Justin Lancy February 3, 2012 at 1:13 pm #

      Hi Ed — And thanks for the donation! 😀

      I’m not sure about placing a note into your email directory, but I think you should be able to adapt this code to create an Outlook Note from a Meeting using AppleScript.

  12. Gazelle March 4, 2012 at 1:19 pm #

    Thank you for making this script. I tried using outlook with my gmail account for a while, but it wasn’t working very well so now I’m using Sparrow Lite. I was wondering if you have a similar script for Sparrow Lite to push emails to evernote or if this script you posted can be edited to do so. I’m new to this script thing.

  13. Eric March 27, 2012 at 9:17 pm #

    Pretty slick

  14. Lemont April 3, 2012 at 11:05 am #

    Is there any way to send without the attachement?

    • Justin Lancy April 3, 2012 at 11:10 am #

      Yes – You could comment out the part of the script that processes the attachment!

  15. Jim Dryfoos April 13, 2012 at 5:02 pm #

    FYI, in my case when I upgraded to SP2, I did indeed find the script missing from the folder. However, I also found the Microsoft didn’t wipe out the old folder/scripts, but instead is using a different directory. With SP1 it was using:

    ~/Documents/Microsoft User Data/Outlook Script Menu Items

    After upgrade to SP2, it is now using:

    ~/Library/Application Support/Microsoft/Office/Outlook Script Menu Items

    I was able to copy my previous scr file from the older subdir to the new and it works again 🙂

    Cheers, Jim

    • Justin Lancy April 13, 2012 at 5:36 pm #

      You’re right, Jim — and I’ve updated the note above accordingly!
      😀

  16. John June 15, 2012 at 11:13 am #

    I love the script! Thanks. Is there a way to attach the email to the Evernote note?

    • Justin Lancy June 15, 2012 at 11:59 am #

      Thanks John!

      I’ll take a look when I’m ready to do the next revision of the script. If it’s possible, I think that would make a great addition for a “Switch” you could turn on (emails with attachments can take up a lot of file space, so not everyone would want to do that).

  17. sergio October 5, 2012 at 10:54 pm #

    Hello, I love your script. Any plans to switch from Growl to native OS X notification center or make it an option?

    • Justin Lancy October 6, 2012 at 1:56 am #

      I do plan to make a whole series of update (including notification Center improvements), hopefully in the not so distant future!

      • Ed October 6, 2012 at 8:30 am #

        That’s great, Justin, that you are planning an update. Your work is hugely useful to me at work. My use is almost exclusively highlighting a meeting in outlook, doing a command-E to get the meeting information into evernote, and then taking my meeting notes in evernote. I use this up to a dozen times a day.

        A couple requests, if you don’t mind.

        It would be great to have an option to avoid the html boxes around the meeting information. I used to hand-edit your work to remove this and make the meeting information much more condensed, but I find myself too busy to do that after the latest release. Another are I would like to condense is the list of attendees. A simple comma separated list would be great. I also eliminated the ics attachment, but included all the others, moved the hrule to separate the content from the notes and added the heading “My Notes:”. I’d be happy to send you my changes to the earlier version if you were interested.

        -Ed

        Here’s what I had, colon aligned:

        Event: Root Cause – April 6th COS Outage
        Start Time: Tuesday, May 8, 2012 1:30:00 PM
        End Time: Tuesday, May 8, 2012 2:00:00 PM
        Location: CONFJAX03A
        Invited: Smith, Tony; Smith, Satyen; Smith, Guruprasanna; Smith, Sharada; Smith, Ed; Smith, Kevin;
        When: Tuesday, May 08, 2012 1:30 PM-2:00 PM (UTC-05:00) Eastern Time (US & Canada).
        Where: CONFJAX03A

        Note: The GMT offset above does not reflect daylight saving time adjustments.

        *~*~*~*~*~*~*~*~*~*

        My Notes:

        Whatever my meeting notes were for this meeting. The information has been redacted to protect the guilty :-).

        • Justin Lancy October 8, 2012 at 9:36 am #

          Hi Ed!

          Thanks so much for the kind words and for letting me know these types of scripts are helpful to you.

          As someone who has written many customized scripts for clients, it’s sometimes hard for me to go the other direction and write a “One Size, Fits All” version that will be useful to most people. I appreciate your suggestions and I’m going to keep it in mind as I revise the script in the future.

          My tendency, though, would be to try and find a easier way for people to customize their own scripts. I have some ideas about how to do this and it’s something I’ll play around with to see if I can find an improvement to the current way of doing things.

          Thanks again for your support, Ed — I really appreciate it!
          Justin

  18. revfisk October 9, 2012 at 10:49 pm #

    Great stuff Justin. A real help. One question: with only blogger level html understanding, how would I remove the part of script which include the customizable note template? I would like to just send the email content itself, without any of the other informatio, which, personally, clogs up my workflow. Is as easy as cutting a section? Can you tell me where to start and stop my cut? Or, where to put “off” in the code? I skimmed through it all but nothing looked clear enough for this rookie hack.

    • Justin Lancy October 10, 2012 at 12:34 am #

      Hey there (and thanks!),

      Right now, I think the code is too intertwined with the script for me to feel comfortable trying to perform an HTML-ectomy in a comment thread. As I mentioned in the comment above, it’s often hard to write a “One Size, Fits All” version that will be useful to most people. When I revise the script in the future, I am going to try and find a easier way for people to customize their own scripts (an “OFF” switch or something). I am also hard at work at giving Veritrope.com users some better tools to collaborate on / create their own versions of the scripts here.

      Sorry that I don’t have an immediate fix, but — believe me — I hear you! 🙂

      • revfisk October 10, 2012 at 3:37 pm #

        Right-o. Eagerly awaiting the update then!

  19. CBH October 16, 2012 at 8:32 am #

    Hi there. Have been trying to use the script in Mountain Lion with Outlook 2011 and Evernote Version 3.3.1, with no success so far. The following error message appear:

    Failed to export
    Item” due to the following error:
    La variable selectedItems no está definida.

    Any thoughts?

  20. Kara M. December 28, 2012 at 7:22 am #

    Hi Justin. I added the script and successfully utilized it three days ago. However, last night, I as moving several things from Outlook to Evernote. I got the Growl notifications like normal that import had started and then that import had been successful, however, the notes aren’t in Evernote – even after syncing repeatedly. Any idea what’s going on. I have the script set up without any of the customization so everything is supposed to just go to my default notebook which is called 1.Inbox (which was appearing properly in the growl notification.

    • Justin Lancy December 30, 2012 at 10:55 pm #

      Hi Kara,

      I’m guessing that this is a known issue with some recent changes in Evernote and, because of that, almost all my Evernote scripts aren’t 100% right now.:-(

      Have been hoping to find some work-arounds, but my time has been pretty limited these days. Check back or follow on Twitter to get updates as they occur!

      • Garnet January 10, 2013 at 1:45 pm #

        I am new to organiztion system on http://www.thesecretweapon.org and I could really use this script that you have made. I bought Growl from the Apple Store, and I have Outlook 2011 SP2, and got your script in the right location to show up on the scripts menu, but when I run the script, your script’s dialog box popups to get notebook name from my list of notebooks, but when I click the send, nothing happens, I never get a new note in my evernote.

        I hope you can find time to fix this. I would try to fix it, but I have very little AppleScript experience.

        • Justin Lancy January 15, 2013 at 4:23 am #

          Sorry to hear it, Garnet!

          Would you try the latest code that I just posted and tell me if it’s now working?

      • Kara January 20, 2013 at 5:08 pm #

        Justin,

        Just wanted to say thanks. I installed the 1/15 code update and everything seems to be working again.

        Kara

  21. Tobias January 12, 2013 at 4:21 pm #

    I installed the script and communication with Evernote works when I hit Command-E (that is I can select a different Notebook for creating the Note). However, on trying to clip an email to Evernote, Growl spits out the Import Error message that the classEVdd of missing value cannot be put as “date ” “”. My system language is German.

    • Justin Lancy January 15, 2013 at 4:21 am #

      I’m wondering if the date formatting on your system is causing the script to fail. Could you change to US/English and see if the script works? If so, I’ll take a look at making the date code work better across different system languages/formats.

  22. Eric January 17, 2013 at 2:10 pm #

    I am also having issues with the compile error for this script:

    SYNTAX ERROR
    Expected “given”, “into”, “with”, “without”, other parameter name, etc. but found “‘”.

    I am using the following:
    Outlook 2011: 14.2.5
    Evernote: 5.0.4

    Thanks for any help!

    Best Regards,
    Eric

    • Justin Lancy January 20, 2013 at 4:31 am #

      It’s possible that you are missing GROWL but, if you have it installed and are still getting a compile error, try cutting-and-pasting the source into your AppleScript editor.

  23. Dan Kraus January 25, 2013 at 11:38 pm #

    Hi Justin, I have followed all the above. Outlook is 14.2, growl is 2.0.1. The Script runs when I click on it at the finder level, but I cannot get the shortcut key to work. It is titled the way you did in the comments. I saved it both as an application and as a script with the mE switch in the name
    ( Send to EvernotemE.scpt). So any idea on what I am doing wrong here? Running OSX 10.8.2

    • Justin Lancy February 13, 2013 at 8:05 pm #

      Hi Dan,

      Sorry for the belated response-I’ve been traveling quite a bit in recent weeks!

      Generally, shortcuts that don’t work indicate a conflict with an existing shortcut. I would recommend trying some different ones to see if that resolves the issue. Also, I have heard that a system restart can sometimes “flush out” the script menu in certain applications.

      Wishing you the best of luck! 🙂

  24. Michael January 29, 2013 at 8:01 am #

    First off:

    Thank you so much for doing this, the script really helps me a lot!

    Just got one problem left:

    When importing emails from Outlook (got tagging switched ON) it only imports the first tag, the ones added after the first comma are gone (each one seperated by a comma with no space inbetween).

    What could cause this?

    Evernote Version 5.0.4 (400702)
    Outlook for mac 2011 Version 14.2.5 (121010)
    Growl 2.0.1

    Best regards,
    Michael

    • Justin Lancy February 13, 2013 at 8:15 pm #

      I think this can happen if you put a space after the comma in a series of tags. (e.g., “One, two, three” and not “One,two,three)

      I will look at adding some code to strip the “leading spaces” from tags in a series – but you can try that now to see if that fixes the problem for you in the meantime!

      • Michael February 22, 2013 at 3:42 am #

        Thanks man, that solved it. Even tho i thought i was leaving the spacebar out the first time.
        All tagged properly now 🙂

        • Justin Lancy February 27, 2013 at 10:22 pm #

          FYI — Just updated the code to fix the “leading space” tag issue! 🙂

  25. Amon February 9, 2013 at 5:01 pm #

    Very slick. Ran into a couple errors i seemed to have made go away with a reboot < no – this is a Mac – not windows 🙂

    I may have misunderstand the functionality, but from what i read i'm expecting a dialogue box to appear to allow me to select the notebook and add tags? I set the following like so:

    property tagging_Switch : ""

    Is that correct?

    Thanks for the awesome script.

    • Amon February 9, 2013 at 5:07 pm #

      Not sure why i didn’t try this before posting, but setting explicitly to “ON” seemed to do the trick. Again – thank you for this!!!!

  26. Jenny February 21, 2013 at 10:02 am #

    I have saved the script and it is working. However, I can not get the shortcut to work. So, the only way I can transfer outlook to evernote is if I highlight an item in outlook and then hit run on my script. Is there a trick I’ve missed?

    • Justin Lancy February 22, 2013 at 12:32 am #

      Hi Jenny,

      I’ve heard that the shortcut I suggest (and use myself) doesn’t work on some people’s computers, presumably due to a conflict with another shortcut. I’d suggest trying to change the shortcut to something else to see if that gets things going.

      Good luck! 😀

  27. Brian February 21, 2013 at 5:13 pm #

    Thanks very much for this script. I’m unfortunately experience the same Syntax error with AppleScript that others have mentioned and haven’t been able to get past it. When I try to save the script, the Syntax Error dialog appears with the error: “Expected “,” but found property.”

    I am running OSX 10.7.5 with Growl 2.0.1 and Outlook 2011. I have tried restarting, as well as copy and pasting the code directly into AppleScript. Any ideas how to fix this?

    Many thanks for your help

    • Justin Lancy February 22, 2013 at 12:40 am #

      Hi Brian,

      A bit of a head scratcher — Wondering if it could be a browser/plug-in issue doing something like changing the quotation marks in the code…

      I’d try clicking the link in a different browser to see if that does the trick. If not, let me know via the Bug Reporter and I’ll email you a copy of the script which compiles on my system!

      • Brian February 22, 2013 at 12:19 pm #

        Hi Justin,

        Many thanks for the quick response. I think it may be a problem with my version of Outlook. I thought I was updated but turns out I am running version 14.0.0. Would that be the issue? If so, is there a modification to the code that would allow it to work with this version, or do I need to upgrade?

        Thanks again.

        • Brian February 24, 2013 at 10:16 am #

          Hi Justin, wanted to follow up to let you know that I updated outlook and everything seems to be working fine now. Thanks a million.

  28. Sergio March 12, 2013 at 5:33 pm #

    Hi Justin, any word on uncoupling this script from its Growl requirement? I’d like to not have to install growl for this one script when I use notification center for everything else.

    Thanks!

    • Justin Lancy March 13, 2013 at 3:05 am #

      Hi Sergio,

      I’m still thinking through how I want to do notifications…

      The great thing about AppleScript, though, is that it’s not too hard to read through the code and edit/tweak to make things suit your particular needs or workflow.

      With a little trial and error, I think you should be able to find and edit out all the Growl portions of the script. Who knows — It could kickstart a whole bunch of AppleScripting for you! 😉

  29. John March 20, 2013 at 7:57 am #

    script does not compile, error messages all over. for example.

    set account_Info to (properties of account info 1)

    expected “,” but found identifier

    • Justin Lancy March 22, 2013 at 6:22 am #

      Hi John — I’m seeing reports of a couple of new Evernote / AppleScript errors, one of which involves scripts not compiling if Evernote isn’t running.

      You may want to double-check that Evernote is open and try again to see if that gets you going. If not, you can use the Bug Report button on this page to send me some more details.

  30. Al April 9, 2013 at 10:56 pm #

    I love using the script. But, there is one problem that I can’t seem to figure out. (This is my first time using applescript ) The script works fine for me only if I have both Outlook and applescript open and click on “Run” in applescript. But I don’t know how to copy the script into the Outlook applescript folder. My applesscript does not give the option for “save as” . . . only “save”. I’m new at this and just cant seem to get the file saved. Thanks for your help.

    • Justin Lancy April 10, 2013 at 12:09 am #

      Hi Al,

      So to make sure I understand what’s happening – When you select ‘Save’, you aren’t given the dialog box which lets you select the location to save the file?

      • Al April 25, 2013 at 10:39 am #

        Justin . . . it’s working! I’m not certain what I was doing wrong, nor what I did right to fix it. But, the good news is that it’s up and running. Thanks so much for sharing your expertise!

  31. Tim Nicholson April 23, 2013 at 12:22 pm #

    I’m very interested in using this and using this, but was wondering if you were going to update the script to use the built-in Mountain Lion Notification Center instead of Growl.

    • Justin Lancy April 24, 2013 at 3:24 am #

      Hi Tim,

      As far as I know, currently there’s no way to send messages from AppleScript to Notification Center with installing additional packages. (GROWL lets you forward to N.C., as does a CLI app called ‘terminal-notifier’).

      If things change, I’m on it. 😉

      • Tim Nicholson April 24, 2013 at 4:19 pm #

        Thanks, Justin. I had seen that someone created an Automator action that would let you post to notification center. It says its specifically for use in Automator “workflows” and I tried it in an “app” that uses a shell script and it didn’t work. I didn’t try very long to troubleshoot it though. Its here: http://www.automatedworkflows.com/2012/08/26/display-notification-center-alert-automator-action-1-0-0/

        Also, I managed to update your script to remove Growl notifications. I am getting an error about the temp directory not existing which maybe I caused or maybe I didn’t (I didn’t touch the trash routines). What I did was just have the script open the newly created notes in individual Evernote windows when its done creating them. I’d be happy to give it back to you if you want, although all I did was comment out all the Growl code rather than elegantly let you specify whether you want to use Growl or not.

  32. Matt April 25, 2013 at 4:41 am #

    Absolutely love this script, thanks so much for creating it, will donate in a mo!

    • Justin Lancy April 25, 2013 at 9:46 am #

      Thanks — Your support is definitely appreciated! 🙂

  33. Andre Baruch April 25, 2013 at 8:40 am #

    Hi Justin

    A different problem
    I just downloaded the script, and the newest version of Growl (2.0.1)

    The script works (nicely too, thanks!)
    BUT, for it to work I have to open the script in the script editor and manually run it The suggested keyboard shortcut (Command E) doesn’t work.

    The scipt is saved as Send to EvernotemE.scpt in the correct location (Documents / Microsoft User Data / Outlook Script Items).

    Any ideas on what silly step I missed as to why this doesn’t work? The links on your page here all suggest that this is the correct file ending to enable the keyboard shortcuts.

    Your assistance is greatly appreciated.

    Kind regards

    Andre Baruch

    • Justin Lancy April 25, 2013 at 9:44 am #

      Ahh… the mysteries of Outlook’s keyboard shortcuts! 😉

      In all likelihood, it’s a conflict with another shortcut on your system. Since every system is different, it would be hard for me to say exactly what is causing the issue on your particular system.

      I would recommend a little trial and error, changing the letter or the modifier key for the shortcut until it works. Good luck!

  34. Matt May 2, 2013 at 3:02 pm #

    Hey Justin- I’m a complete newbie with this Mac stuff, but have been using Evernote for years. I ran across this awesome page yesterday and tried the script. After some initial issues due to user error, it worked perfectly…until just a few minutes ago for some reason. I now get the Syntax Error- ‘Expected “,” but found identifier.’ I haven’t changed anything. Any words of wisdom?

    • Justin Lancy May 3, 2013 at 3:07 am #

      Hi Matt,

      Perhaps it’s a new-ish bug with Evernote – Many people are reporting that Evernote AppleScripts aren’t working unless the application is already running… I’d try opening Evernote first and then retrying.

      Does that get you going again?

      • Matt May 3, 2013 at 8:06 am #

        Yes indeed! That was simple enough. Thanks so much!

  35. Tim May 6, 2013 at 12:48 pm #

    Justin,
    Great script, using it a lot. One question I have for recurring Outlook meetings. The script is grabbing the creation date of the meeting (original invite) when moving it into Evernote, it would be great to use the date of the meeting you have in context for the start dt/tm. Thanks for your work.

  36. Chris May 10, 2013 at 11:21 am #

    Thanks for the great script! Its been basically flawless for me and I use it daily to keep my Inbox at zero.

    One question – Is there any way to send the e-mail to Evernote as an attachment? This way I can open it up and reply directly, without having to hunt down the original e-mail to reply.

    Apologies if you already answered this.

    • Justin Lancy May 24, 2013 at 12:35 am #

      I wish Outlook offered the same URL handler “link back” to the original message as Mail does; If they did, I would implement it before the ink was dry on the addition to the AppleScript Dictionary. ;-P

      That said, I believe there’s a way to save an Outlook message via AppleScript. It’s not something that I would use personally but, if enough people ask for it, I’d look at putting it into a future revision of the script.

      • Chris May 24, 2013 at 10:04 am #

        Thanks – is there some documentation around saving messages that you can point to? I can try to take a stab at it.

        FWIW, you can drag an e-mail to Evernote and it attaches the email as an attachment. I wonder if that code is public?

        • Justin Lancy May 28, 2013 at 11:23 am #

          There isn’t any documentation that I know of, but I see that there is a ‘Save’ command in the Outlook Dictionary.

          • Chris May 29, 2013 at 12:45 pm #

            Thanks – I was actually able to hack something together over the weekend. Isn’t the most elegant but gets the job done. (And yes used the “Save” command).

            Thanks again for the script!

          • kork June 16, 2013 at 6:21 am #

            would it be possible to share the code which enabled you to save the e-mail as an attachment to the note that you are saving in evernote?

          • Chris June 30, 2013 at 9:57 am #

            Here it goes. It isn’t pretty and doesn’t work if you are sending multiple emails to Evernote. Essentially two parts to add. 1) Save the email to your computer. 2) Attach the email to the note to Evernote. It saves the email to a file called “test.eml”. In a folder called “MS_Emails”.

            1) Add this block right under the line that says “try — GET MESSAGES”

                        set folderPath to ((path to home folder from user domain as string) & "MS_Emails") --PATH TO YOUR FOLDER
                        --TEST IF FOLDER EXISTS. IF NOT CREATE IT
                        if (do shell script "/bin/test -e " & quoted form of (POSIX path of folderPath) & " ; echo $?") is "1" then
                            -- 1 is false
                            do shell script "/bin/mkdir -p " & quoted form of (POSIX path of folderPath)
                           
                        end if
                       
                        set messages_ to the selection
                       
                        --ITERATE THROUGH THEM AND SAVE THEM
                        repeat with i from 1 to number of items in messages_
                            set theMsg to item i of messages_
                            set textPath to folderPath & ":test.eml" as string
                            save theMsg in (textPath)
                           
                        end repeat

            2) Add this block right ABOVE where it says “–IF ATTACHMENTS PRESENT, RUN ATTACHMENT SUBROUTINE”

                            set textPath to ((path to home folder from user domain as string) & "MS_Emails:test.eml") --PATH TO YOUR FOLDER
                           
                            tell application "Evernote"
                                tell theNote to append attachment file textPath
                            end tell
  37. Scott July 17, 2013 at 12:35 pm #

    Anyone have an idea of how to move an email to an “Archive” folder (subfolder of “Inbox”) after exporting it to Evernote?

    The way I tried to do it was adding the following code to the item_Process subroutine, right before the note creation code (i.e., as the last thing done on any message items):

    –MOVE TO ARCHIVE FOLDER
    set theAccount to account of selectedItem
    set archiveFolder to folder “Archive” of folder “Inbox” of theAccount
    move selectedItem to archiveFolder

    This was based on code I found here: http://www.matthewjmiller.net/howtos/mac-outlook-2011-move-to-folder-macro/

    My solution both didn’t work (email is not moved) and seems to have broken the script. I’m now getting an error message that “[…].Trash:Temp Export From Outlook 143: wasn’t found.” I’m continued to get this error even after deleting my added code – I had to delete the whole script and download a fresh copy!

  38. George August 23, 2013 at 1:05 am #

    I noticed that in Apple Mail, you can add a rule and have it execute an AppleScript when a certain piece of mail comes in.

    Would it be possible to tweak this code so that when an email arrives from “X User,” it adds specific “X user” tags so Evernote knows where to put it? When “Y User” emails, it adds “Y tags”?

    I could for example point to multiple instances of this code (one for each rule) if that would make it easier to set multiple rules. I’m new to this, any help would be much appreciated!

    • Justin Lancy September 15, 2013 at 2:27 pm #

      Not sure about your specific scenario, but my experience with AppleScript suggests that there’s usually a way to get things done – especially if you’re willing take time to customize your code! 🙂

  39. Andreas August 31, 2013 at 7:07 am #

    Hi,

    thanks a lot for that wonderful script! As long as Evernote is already open it works perfectly for me. One question: I often want to save the Evernote link to the note, for example when I create a task or an appointment that references the note. Is there a way the script could return the link? Then perhaps (I am an Applescript newbie) one could string together the “create task from message” script that ships with Outlook and your script to create a task with embedded link. That would save the problem that tasks in Outlook cannot have attachments.

  40. Lynn September 15, 2013 at 4:44 pm #

    Justin, nice work, the script is very useful for my workflow.

    Any plans to retain the formatting of the text in the original email? It appears in Evernote with all formatting, paragraphs, etc. removed. It’s difficult to read the email it was forwarded and replied to multiple times as it all runs together.

  41. Lynn September 15, 2013 at 5:06 pm #

    Justin,

    I noticed that the lack of formatting appears to be an error. Most emails I export to Evernote retain the proper formatting. On only some of them, the formatting is removed. Also, there are a small number of emails that the script does not generate the Template header in Evernote. I haven’t determined what causes it, but the same email will not include the header information, no matter how many times I export it to Evernote, while most other emails show up in Evernote with the header info.

    I’m using Outlook 2011 v 14.3.2
    Evernote v 5.2.1

  42. Jan October 23, 2013 at 4:11 pm #

    Hi Justin,

    Thanks for the cool script. I’m pretty new (okay, *really* new) to AppleScript but was able to get this installed and running like a charm. Here’s my issue: I would like to send calendar items to evernote using your script, but I’d like the title of the note to be the actual subject of the calendar event – right now, the evernote note says, “Text Clipping from Outlook.” Any quick way to tweak the script to do that?

  43. Shawn Hungate October 23, 2013 at 5:18 pm #

    Dear Justin,

    This is a life saver. Great script! With Apple just recently releasing Mavericks, do you think this script will still work with Mavericks? (I am currently using it under Lion – 10.7). I would love to upgrade to Mavericks, but won’t do it for fear of losing this one ability this script gives me.

    Thanks!

    • jm November 7, 2013 at 9:24 am #

      I am running mavericks on my macair and get a message when trying to use this script

      The script contains uncompiled changes and cannot be run.

      I had no problems setting up the script on my macbookpro running lion

      How do I get to run on macbook air?

      • Justin Lancy November 17, 2013 at 3:25 am #

        Several people are reporting Mavericks issues. I’ll try to take a look soon!

  44. Gregory Van Tighem November 15, 2013 at 11:28 am #

    HI Justin:

    I tried to download your script and install it. I was able to open it in Apple Script and even run it. Worked like a charm from Apple Script. And when I look in the Outlook Script Menu items – ~/Library/Application Support/Microsoft/Office/Outlook Script Menu Items, I see it’s there.

    But when I tried to open it in the Outlook Script Menu Items folder from the “About this menu” I can’t see it to open it. BTW I just realized that the instructions on my “About this menu” say “To add a script or workflow to this menu, copy it to the Outlook Script Menu items folder located in your Library/Application Support/Microsoft/Office folder.”

    Should I be saving the script in this folder and not the Outlook Script Menu Items folder? (Maybe I’ll try this and see if that works. But I think saving it to the Outlook Script Menu Items folder using the path you outline in your instructions above is correct. i just don’t understand why the Outlook Script function can’t see it.)

    I run the Mountain Lion Operating System 10.8.5 and Outlook 14.3.8 (would that be SP3?) I also have Growl 2.1.3.

    Please advise.

    I am also having difficulty understanding exactly how to revise the script so that I can turn on a dialog box allowing me to tag and sort items on the way in to Evernote.

    Thanks,

    Gregory

    • Justin Lancy November 17, 2013 at 3:06 am #

      I would suggest using the “About this Menu” path to find the correct folder (Microsoft moved the default location a while back.)

      To turn on the dialog box, make the following change before saving the AppleScript:

      Find this property at the beginning of the script…

      property tagging_Switch : "OFF"

      Change it to…

      property tagging_Switch : "ON"
  45. Leo November 17, 2013 at 12:46 pm #

    Terrific script. I am exporting very large numbers of emials from .PST files and I frequently get a “Downloading Content…” message that times out the script. I chenged the default timeout in the script from two minutes to an half-hours (not sure which sub routine was hanging up, so I just added the change to all of them). It seems to work fine now, but just wondering if you have any insight to what is going on.
    Also, is there an easy way to have the original email added as an attachment to itself (so that I could click on it in Evernote and have it open right in Outlook)?

    • Justin Lancy November 21, 2013 at 12:47 am #

      Hi Leo!

      The “Downloading Content…” message is an indication that Evernote is trying to download content (usually images) into the note in order to render it. I’ll look at adjusting the script time out and perhaps adding a setting to attach an email to the note in a future version. (Sadly, Outlook doesn’t have a direct message link available like Mail.app does…)

  46. Jon Dixon November 20, 2013 at 4:00 pm #

    Hi Justin,

    I just installed your script on my iMac running Mavericks. When I try to compile the script the 1st error is:
    if raw_Class is calendar event then set the_class to “Calendar”
    Syntax Error
    Message: Expected “then” etc. but found class name.

    as I deleted “then” the next error was “incoming message” – it does not like the double words – you can delete message and go on.

    next error is:

    set t_Recipients to (to recipients of selectedItem)
    Expected expression, “)”, etc. but found “to”.

    And I suppose the errors continue. I am not a script or but would really love to get this working in Mavericks.

    Any help would be appreciated, because I transport a number of emails daily into Evernote.

    Thanks for your work.

    Sincerely,

    Jon

    • Justin Lancy November 21, 2013 at 12:56 am #

      Hi Jon,

      I just added a debugging tool to help figure out these types of errors. (You’ll find it at the beginning of this page.)

      • Jon Dixon November 21, 2013 at 2:25 pm #

        Hi Justin,

        Thanks – I got the tool and submitted the bug report.

      • Jimmy December 6, 2013 at 11:05 am #

        Having the same problem as Jon now. I submitted a bug report earlier for the “,” syntax error, but found the fix was to relaunch Evernote and recompile. Did that and got past that error only to run into the same error as Jon. Any updates yet?

        Thx…

        • Justin Lancy December 6, 2013 at 8:41 pm #

          Interesting note about the relaunch!

          No new news here: This Outlook/Evernote/10.9 error is probably going to take some time to track down because people with (seemingly) identical configurations are getting different results. Works fine for some; For others, not so much… 😉

          I saw from the Bug Report you emailed that you have the latest versions of Outlook/Evernote/Growl. I’d encourage you to try compiling the script again if additional updates for these roll out, as well as after 10.9.1 comes out (should be within a few days).

          In the meantime, I’ll keep collecting reports and see if I can identify a common thread.

          • Jimmy December 6, 2013 at 10:51 pm #

            Will try it again after the update. Will post the results here. Thx

          • Jimmy December 9, 2013 at 1:39 pm #

            Justin – don’t know if this helps, but I decided to try the Mail version of the script and it works fine. I can run the apple script and it moves the files just fine.

            Thought I would pass that along. Not sure how big a difference it is between the two, but thought it might help.

            THx

    • Bill Hansley March 18, 2014 at 5:27 pm #

      I had the same problem – seeing two-word arguments as invalid. I followed another suggestion about disabling Parallels sharing with Mac and that solved the problem. Virtual Machine -> Configure -> Applications -> uncheck ‘Share Windows applications with Mac’. v1.06 compiled and ran great once I changed that.

      SO GLAD to have this up and working, and without the Growl requirement!

  47. Josh December 4, 2013 at 9:21 am #

    I’m running Mavericks and the script continues to work fine for me (I haven’t tried recompiling it though). But after a recent update to Outlook 14.3.9 I now get a popup message “There is no application set to open the URL cid:[email protected].” I get a similar message for each image in the email being sent to Evernote.

    Interestingly, the images all seem to come through into Evernote just fine after I click “Cancel” on each of those popups.

    Any idea how to get around this (useless) popup message? The script is still working well other than the need to click away a message for each image.

    • Justin Lancy December 4, 2013 at 11:22 pm #

      Hi Josh – Not sure what that’s about, but it sounds annoying! 😉

      To me, it sounds like some sort of WebKit glitch. No idea if this will help but, occasionally, clearing out Safari’s cache and restarting will fix weird issues like these. In the meantime, I’ll keep my eyes open for any other possibilities.

      • Michael Karl December 12, 2013 at 2:30 am #

        I am running Mavericks (10.9) and Outlook 2011 14.3.9 and receive the similar error as Josh “There is no application set to open the URL cid:[email protected].” I have cleared history on Safari, re-installed Growl and the same error continues. Another observation is that if I have (property tagging_Switch : “OFF” ) none of the properties “EVnotebook and/or defaultTag” change the behavior of the upload. If I have (property tagging_Switch : “ON” ) the script works perfectly (I can select notebook and the tags work) with the exception of the popup message continues with different image names in the popup. If I choose evernote as the application on the pop-up dialog it opens evernote but the popup dialog continues for each item I add. If I choose safari in the popup dialog it opens safari and tries to open the link of “file:///cid:[email protected]” but of course it can’t open anything, and the dialog continues each time the script is ran.

        This is a really cool script and much more powerful than e-mailing messages to Evernote! If there is anything I can do to help troubleshoot this for you I’d be happy to! I’m not a code guy but if you need me to grab screen shots or something please let me know!

    • Luis Saha January 3, 2014 at 5:40 pm #

      I have the same problem… It’s really annoying.

    • Eric Sullender January 13, 2014 at 12:45 pm #

      I am having the same problem, but it only appears to occur on emails that have an Outlook ‘signature’ that includes an image that is embedded in the email. This happens on the first attempt, but subsequent attempts of the same note seem to work fine. Odd…

      Unrelated, a great feature would be the ability to add a ‘reminder’ with a date when sending the note. Also, being able to have a default notebook, but select tags would also be nice.

    • Steven January 16, 2014 at 2:10 pm #

      I am getting the same “There is no application set to open the URL” error message now. Has anyone found a resolution yet?

      thx!

  48. Scott December 27, 2013 at 12:49 pm #

    Modification – default tag without prompt:

    This is for anyone that wants to skip the dialog, but wants everything tagged with one particular tag.

    1. Make sure tagging_Switch is set to “OFF”
    2. Make sure to set the defaultTag property with whatever tag you want applied to everything processed w/this script.
    3. In the “MAIN PROGRAM” section, at the end of “–RESET ITEMS,” add this: if tagging_Switch is “OFF” then set EVTag to Tag_Check({defaultTag})

    That’s it!

  49. Grant Davies December 31, 2013 at 10:59 am #

    I must be missing something but when I click the “open in script editor” I’m getting the 1.05 script instead of the 1.09.

    I too run mavericks and get the error Josh has above : URL cid:[email protected].

    It an issue where the image is embedded in the email instead of an attachment, for some reason the script doesn’t know what to do with it anymore.

    • Justin Lancy January 11, 2014 at 4:08 am #

      Script is version 1.05; OSX is version 10.9. 😉

  50. John January 3, 2014 at 11:28 am #

    Wanted to post a resolution to a problem that has not yet been addressed here. If you are running Windows via Parallels, the script will not likely compile throwing expected “then” found “method” error that other people have been experiencing for other reasons. After hours of research and debugging efforts, the problem has been identified and resolved:

    Problem: Script finds Windows Outlook rather than Mac Outlook (as determined by the debugging script for identifying the version of Outlook that is installed)

    Resolution: Launch Parallels, Control Click on the Icon for Parellels, Go to Configure, Go to Options tab, Go to Applications tab, Unclick Share Mac Applications with Windows and Unlick Share Windows Applications with Mac. Restart Parallels. Restart Mac. Re-compile. WALA. (Source: http://download.parallels.com/desktop/v6/docs/en/Parallels_Desktop_Users_Guide/22694.htm)

    • Justin Lancy January 11, 2014 at 4:09 am #

      Anybody else find that this resolves their compilation issues?

      • Reza February 17, 2014 at 3:46 pm #

        Yes, this solved the issue for me.

  51. Jimmy January 6, 2014 at 7:13 am #

    Josh – I have tried to recompile the script with the 10.9.1 update and all the most recent versions of Outlook, Evernote and Growl. Sadly no luck.

    I did try a few things and it appears that the script doesn’t like the separated words as Jon Dixon described above. At each error where it states “Expected x, but found class name” or similar, if you join the two words like “email address” as “email_address” the script will move on. Don’t know if that means anything, but thought I would throw it out there.

    • Johan January 9, 2014 at 2:12 am #

      I can confirm that I am experiencing the exact some issue.

    • Jimmy Newman March 21, 2014 at 1:31 pm #

      I got it to work based on another suggestion by Bill Hansley. This change allowed the scrip to run no errors.

      “Author: Bill Hansley
      Comment:
      I had the same problem – seeing two-word arguments as invalid. I followed another suggestion about disabling Parallels sharing with Mac and that solved the problem. Virtual Machine – Configure – Applications – uncheck ‘Share Windows applications with Mac’. v1.06 compiled and ran great once I changed that.

      SO GLAD to have this up and working, and without the Growl requirement!”

      Thanks to Bill.

      Jimmy

  52. Bill January 24, 2014 at 4:31 pm #

    When I run script I get this message from growl: Failed to export
    Item” due to the following error:
    Microsoft Outlook got an error: incoming message id 1281 doesn’t understand the “count” message.

    I have latest version of growl and am running OSX 10.9

    • Justin Lancy February 1, 2014 at 2:05 am #

      It may be that you’ve selected the folder and not the individual messages inside. Try selecting a few items and trying again!

  53. William February 7, 2014 at 1:18 am #

    Love the script. I love the updates. Anyway to have a check box or something that allows to turn on the reminder?

    Made donation earlier and appreciate all the coding. I do understand having written SQL scripts that are over 13 pages 🙂

  54. sergio February 26, 2014 at 12:47 pm #

    Hi, I too had issues on 10.9 and submitted a bug report. Was wondering if you’ve had any luck tracking down the the gremlins?

  55. Grant Davies April 6, 2014 at 9:24 pm #

    I tried script 1.06 with mavericks 10.9.2, but having issues still, compiler errors like :

    Expected “then” , etc, but found class name

    for this line :

    if raw_Class is calendar event then set the_class to “Calendar”

    I changed it to calendarEvent just for the heck of it, then the same unexpected “then” for the line

    if raw_Class is incoming message then set the_class to “Message”

  56. dr.poo April 12, 2014 at 3:39 am #

    thanks! it works perfectly except … it makes a note in evernote but with no title and no content. it just says “text clipping from outlook”.

  57. Jim April 29, 2014 at 1:42 am #

    Thanks for a great script. Unfortunately I’m still running Mt. Lion. Do you still have a version that runs on Mt. Lion?

  58. Chris May 25, 2014 at 12:47 pm #

    This script is a lifesaver. I am a school counselor and my school district has just switched over to Apple products and I have been struggling with not having the send to evernote plug in that was available in the pc version of outlook. I am very new to applescripts and macs so I am on a steep learning curve here, so pardon the ignorance of my question. Is there a way to set this script up so that there is a drop down or auto complete for available tags in the tag entry box? I use tags extensively and it is impossible to remember the exact names of all of them, but choosing from a drop down or autocomplete would be fabulous.

    • Justin Lancy May 25, 2014 at 1:04 pm #

      Not an ignorant question at all!

      I agree that autocomplete would be great, but it isn’t possible with basic AppleScripting. (Tech Note: I believe it’s possible in the more advanced AppleScript framework called AppleScriptObjC)

      A drop-down list would be possible. If enough people ask, I’ll look at making it happen!

      • Chris May 25, 2014 at 1:22 pm #

        Thanks so much for your quick reply. I hope enough people are interested to make it worth your while! Thanks again for such a great addition to my workflow!

  59. Vincent June 14, 2014 at 12:42 am #

    Great script. Thank you!

    One thing I am missing so far in TSW is the ability to easily reply to emails that have been moved to Evernote. The solution in the thread linked below is to drag the email to Evernote where it will show up as a .eml (or .msg) file. If you double click the file you are back in outlook with the right message ready to reply. Nice, but now you have to double click the file to see the email message since you cannot see the text in Evernote.

    I was wondering if it is possible to use your script to (1) move an email to from Outlook to Evernote and (2) add an .eml file to the same note as an attachment to make replying to email a little easier.

    Even more perfect would be if the .eml message also already had my personal Evernote email address entered into a BCC field so the reply can be logged automatically as well 🙂

    http://www.thesecretweapon.org/forums/topic/not-getting-the-evernote-outlook-link

  60. 8footasian June 24, 2014 at 2:36 am #

    simply awesome. been looking for a way to do this with 2011 outlook and stumbled upon your script. thank you thank you thank you ;-D

    • Justin Lancy June 24, 2014 at 2:40 am #

      Glad you enjoyed it and thanks for taking the time to send a note! 🙂

  61. Patrick July 16, 2014 at 7:52 pm #

    This looks like it will be a great work-around if I can get it working correctly. Thanks.

    Two problems:

    1. I can’t seem to find a shortcut that will work. I’ve tried mE, msE, sE, mW, mR, MX, etc. Nothing seems to work, so I’ve just been manually doing it by clicking it in the dropdown from the script icon. Any ideas?

    2. When I try to send messages with attachments, I get the following message:

    There is no application set to open the URL cid:[email protected].
    Search the App Store for an application that can open this document, or choose an existing application on your computer.

    There are then three options: Choose Application…, Cancel, Search App Store. Clicking Cancel just stops the attachments from coming in. I’ve tried choosing Evernote as the application, but that just stops the whole message from being sent. Any help here?

    Again, thanks for the script. Hopefully you can help me figure this out so I can really utilize it!

    • Justin Lancy July 17, 2014 at 11:56 pm #

      Hi Patrick!

      1. Not really sure what’s going on with your keyboard shortcuts. I’ve seen a system restart sometimes flush out the script menu cache so, assuming that you’ve confirmed you’ve named the script correctly, that’s what I’d try next.

      2. There is a workaround for when this happens – At the top of the script, there is a property which reads:

      property stripEmbeddedImages : "OFF"

      Change this to:

      property stripEmbeddedImages : "ON"