Developing code and new ideas

Add Evernote GTD Tasks To Google Calendar For Easy Reminders

I’ve used Evernote for Getting Things Done aka GTD for a few years and one of the drawbacks has been the lack of calendar integration and reminders. I’d always longed for an easy way to export my GTD tasks to Google Calendar and leverage its SMS reminders.

Recently I discovered that Google had its own scripting environment called Google Apps Scripts which provides the ability to interact with G-Tools such as Gmail and Google Calendar. That led me on a quest to finally come up with a solution for getting my time based tasks on my Google Calendar for easy reminders.

I’ve created a script that will allow me to send notes from Evernote to my Gmail account and have those notes automatically added to any calendar with reminders. I prefer this method over services like Event Noted or IFTTT.com because it gives me full control over what happens in the integration. Not to mention that using a Google App Script frees me from having to introduce an additional 3rd party into the integration mix.
Below are the steps that I used to add my script to my Google account for making adding time based Evernote tasks a breeze. Keep in mind that there are many ways to accomplish the tasks I’ve outlined below. If you choose to follow these instructions your mileage should end up fairly close to mine.

Requirements

To accomplish setting up the en2gcal script you will need the following.

Creating a Gmail filter

The first step in the process is to create a Gmail filter that will automatically label incoming emails sent to a special +EN address. The script is set up to look for these types of emails and will process them shortly after they arrive in your inbox.

Log in to Gmail, select one of your emails and then from the More menu choose Filter messages like these. This is a quick way to get to the Create Filter dialog. We will specify our own values in this dialog so it does not matter which email you’ve select from your inbox.

Clear any values in the From, Subject, Has the words and Doesn’t have boxes and ensure that Has attachment is unchecked.

Next, using the Gmail address of the account you’re logged into populate the To box then append +en to the username portion of the address. For example, if your Gmail address is mygtdemail@gmail.com then enter mygtdemail+en@gmail.com into the To box.

Including the +{value} to your email address is a little known feature of all Gmail accounts. You can append any value you’d like to the username portion of your email address as long as you separate it with a plus sign and it complies with email formatting standards. We’ll leverage this feature to give our Gmail account its very own Evernote related address.

Filter emails sent from Evernote to the username+en@gmail.com address

Advance to the next screen by pressing the Create filter with this search » link in the lower right.

On this screen choose to apply a label called .reminder to any email addressed to our username+en@gmail.com account. You can also specify additional actions you’d like to perform on these types of emails. For example, I chose to mark these as read and archive them as soon as they come in so that I don’t see them in my inbox. The choice is up to you.

Apply a .reminder filter to incoming emails sent from Evernote to the username+en@gmail.com address

Finally, click Create Filter to save the filter.

As a test, send an email to your +EN (e.g. mygtdemail+en@gmail.com) address and ensure that it gets labeled with .reminder. For the subject use Important meeting tomorrow at 3pm.

Note that if you’ve set the filter to auto archive this email it won’t show up in your inbox and you’ll need to view all mail to see it. Leave this email alone for now as we’ll use it below to ensure that the script is working correctly. The important thing here is to ensure that the email gets labeled properly.

Adding the integration script to Google Docs

The next step is to add the en2gcal script to your Google Docs. To do so log in to your Google Docs (aka Google Drive) account, choose to Create a new Script and add that to a Blank Project.

Create a new Google App Script in Google DocsCreate a Blank Project to store the Evernote Reminder App Script

Next, copy the en2gcal script from GitHub and paste the entire contents into the Code.gs file overwriting any code that already exists.

Finally, save and name the project with something identifiable such as Evernote Reminder.

Now that the script is saved and we have an email in our inbox labeled with a .reminder that’s waiting to be picked up let’s run the script to first grant all the permissions then again to ensure that it is working properly. Either click the ▶ in the button bar or choose Run > addReminder from the menu.

The first time you run the script a dialog box will appear asking that you give authorization for the script to run. Read over its contents then click the Authorize button.

Authorize the Evernote to Google Calendar Reminder Script

You must also grant permissions to allow the script to access the Gmail and Google Calendar associated with your Google Account. Read over the message and click Grant Access.

Grant access to Google App Script

You will then see a message stating Authorization Status – Now you can run the script.. Click the Close button here and run the script again. The second time you run the script you will not receive any of the warnings as you did the first time.

Assuming no errors occurred while running the script a second time you can now open your Google Calendar and find a new event entitled Important meeting that was added tomorrow at 3pm.

Setting the script to run automatically

Now that the filter and script are set up we need to ensure that the script runs automatically at some interval. Otherwise, you’d need to press the run button every time you wanted the script to process .reminders and where’s the fun in that?

A nice feature of the Google Apps Scripts environment is that it provide the ability to trigger scripts on certain events. In our case we’re going to use a Time-driven event and set our script to run every 5 minutes. You can adjust this time to meet your requirements.

To add a new trigger switch back to the script window in Google Docs and click the Resources > Current project’s triggers menu. Because this is the first trigger you’ll set up you will see a link that says No triggers set up. Click here to add one now.

Ensure that your selections match those shown below and again adjust the time to meet your needs.

Add Google App Script Trigger

Finally, press Save to commit the trigger.

Now the script will fire every 5 minutes and will process any emails in your inbox labeled with .reminder we’re ready to test from Evernote.

Adding a note from Evernote to Google Calendar

Before we move on I want to note that not every Evernote client provides the ability to modify the subject of a note shared via email. Setting the title of the note or changing the subject is critical to this process. I’ve confirmed that both the current Windows and Android clients allow you to modify the subject however I know that the iOS version does not. Also, I have not been able to confirm this on OS X or any other platform so this is where your mileage could vary.

As a work around to changing the subject of the email you can edit the the title of note itself and save it before attempting to share via email. This isn’t such a problem but it means that your note titles in Evernote will contain extra info that may clutter up your view.

I’ll describe the steps you’ll need to perform from the Windows client. You’ll need to experiment with your client of choice.

To add an event with a reminder for any note in your Evernote system first right click on the note and choose Share > Send by email…. I’ve selected to email a note entitled Call Billy Ray to get update on pork bellies as shown below.

Send email reminder from Evernote to Gmail

You will then be presented with the following dialog. It is here that you will specify such things as when the event is to occur, the types of reminders and their times, and which calendar the event should be added to.

Send email from Evernote to Gmail including a reminder

When the dialog appears it must be addressed to your special +EN gmail account. The filter you set up previously will trigger on the receipt of this email. And, as you can see in this screenshot I’ve also modified the subject which was pre-populated with the note title by appending Next tuesday at 3pm pop:5 sms:10 cal:”My New Cal” to it.

The en2gcal script will use this information to create a new event on the My New Cal calendar that occurs next Tuesday at 3pm. It also creates a pop-up reminder for 5 minutes before the event and an SMS reminder 10 minutes before. Note, you must have SMS turned on in your Google Calendar settings to receive SMS reminders.

After making all the modifications press the send button to start the process. It should arrive in your Gmail account where the trigger will add the .reminder label.

Email reminder sent from Evernote

Shortly thereafter the script will process any emails with a .reminder label and create the appropriate event. As you can see an event was created using the original Evernote task title with the extra event related text removed. It also created the event in the designated calendar at the designated time and added the designated reminders.

Google Calendar event originating from Evernote

Voilà!

Script subject parameters explained

When sending an email from Evernote to your special Gmail +EN address you must specify the time and date of the event to be created. These details can take on many forms and may take some experimentation to ensure events are created as expected. Here are a few examples:

12/13 @ 4p – Creates an event on Dec 13th at 4pm

Dec 13 4p at Randolph and Mortimer’s house – Creates and event on Dec 13th at 4pm with Where field populated with Randolph and Mortimer’s house

Tomorrow from 4:15 to 5:05 – Creates an event tomorrow from 4:15 to 5:05

Saturday all day – Creates an all day event on Saturday

Every tues at 2pm for 6 weeks – Creates a recurring event for the next 6 weeks starting next Tuesday at 2pm

Optional Script parameters

Each of the options below can also be included but are completely optional. They can be specified in any order as long as they appear after the note title.

pop:{minutes} – Signifies that a Pop-up reminder should be added using the minutes specified. If it is not included no Pop-up reminder is created. Example: pop:15

sms:{minutes} – Signifies that an SMS reminder should be added using the minutes specified. If it is not included no SMS reminder is created. Example: sms:30

email:{minutes} – Signifies that an email reminder should be added using the minutes specified. If it is not included no email reminder is created. Example: email:45

cal:”{calendar name}” – Signifies that the event should be created on a specific calendar. If this option is not specified then the event will be created on the accounts default calendar. Also note that calendars containing spaces in the name must be enclosed in single or double quotes. Example: cal:”Buy Low”

Setting up script defaults

If you know that you always want to do such things as include a 15 minute email reminder or always want the event created on a particular calendar you can specify defaults in the script User Properties to prevent having to specify those options on the subject each time.

To set these up return to the Google Docs script window that contains the en2gcal script. Choose File > Project properties… and change to the User Properties tab. Here you can add any of the properties from the above list as a default script property.

The script will then use these values by default if they are not specified on the email subject. You can override these values on a per-email basis simply by specifying them on the subject line.

Set default properties for calendar and reminders

Conclusion

I hope you find this process as useful as I have. Feel free to submit improvements to the script via GitHub or to the process in the comments. Please leave feedback. Thanks!

If you’re interested in Google Apps or Getting Things Done here are a few books that I recommend checking out.