Skip to content

Instantly share code, notes, and snippets.

@nwcell
Last active January 13, 2016 16:29
Show Gist options
  • Save nwcell/11462732 to your computer and use it in GitHub Desktop.
Save nwcell/11462732 to your computer and use it in GitHub Desktop.
Evernote Tip: Filter for Incomplete Reminders

##Incomplete Reminders Search:

The script is pretty basic and goes like the following:

-reminderDoneTime:00011231 reminderOrder:00011231

###How it works To start with, reminderDoneTime:[datetime] returns true if it finds a date that is on or after what is listed. We can invert this by prepending the query with a -. As a result, -reminderDoneTime:[datetime] returns true if the note either has no timestamp or if it has a date before [datetime].

Since de-checking a previousely sompleted remender sets the timestamp to 00001231T000000Z (0 AD), selecting for 00011231 (1 AD) will work just fine.

Because we only want to see reminders, we'll need to filter for them. In a note, reminderOrder is added to any note that is turned into a reminder. The same thing that happens to reminderDoneTime happens to reminderOrder if the reminder aspect is deactivated. This means that we want to filter for 00011231 here as well (but not inversed). That leaves us with reminderOrder:00011231.

Once again, when we combine these, we get our final filter:

-reminderDoneTime:00011231 reminderOrder:00011231

###Sources

Where I started

<!-- Working sample of completed reminder. Re-save as .enex before you try and import ;-) -->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE en-export SYSTEM "http://xml.evernote.com/pub/evernote-export2.dtd">
<en-export export-date="20140501T211023Z" application="Evernote/Windows" version="5.x">
<note>
<title>time dirty test</title>
<content>
<!-- stuff goes here -->
</content>
<created>20140501T210944Z</created>
<updated>20140501T210948Z</updated>
<!-- Please note the attribute section -->
<note-attributes>
<!-- Exists for all reminders -->
<reminder-order>20140501T210950Z</reminder-order>
<!-- Exists only for reminders with dates -->
<reminder-time>20140502T160000Z</reminder-time>
<!-- Exists for reminders that are checked -->
<reminder-done-time>20140501T211002Z</reminder-done-time>
</note-attributes>
</note>
</en-export>
<!-- Note that the same pattern holds true for other reminder elements -->
<!-- A 'cleared' reminder -->
<note-attributes>
<reminder-order>00001231T000000Z</reminder-order>
<reminder-time>00001231T000000Z</reminder-time>
<reminder-done-time>00001231T000000Z</reminder-done-time>
</note-attributes>
<!-- Completed reminder's attributes -->
<note-attributes>
<reminder-order>20140501T210950Z</reminder-order>
<reminder-time>20140502T160000Z</reminder-time>
<!-- If a reminder has EVER been marked complete, it will have a timestamp here. -->
<reminder-done-time>20140501T211002Z</reminder-done-time>
</note-attributes>
<!-- De-completed reminder's attributes -->
<note-attributes>
<reminder-order>20140501T210950Z</reminder-order>
<reminder-time>20140502T160000Z</reminder-time>
<!-- If a checked reminder was un-checked, the element stays, but the timestamp chagnes to 00001231T000000Z (0 AD) -->
<reminder-done-time>00001231T000000Z</reminder-done-time>
</note-attributes>
<!-- Brand new reminder's attributes -->
<note-attributes>
<reminder-order>20140501T210950Z</reminder-order>
<reminder-time>20140502T160000Z</reminder-time>
</note-attributes>
  • All Reminders: reminderOrder:00011231
  • Incomplete Reminders: -reminderDoneTime:00011231 reminderOrder:00011231
  • Complete Reminders: reminderDoneTime:00011231 reminderOrder:00011231
-reminderDoneTime:00011231 reminderOrder:00011231
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment