nwcell
5/1/2014 - 9:52 PM

Evernote Tip: Filter for Incomplete Reminders

Evernote Tip: Filter for Incomplete Reminders

-reminderDoneTime:00011231 reminderOrder:00011231
  • All Reminders: reminderOrder:00011231
  • Incomplete Reminders: -reminderDoneTime:00011231 reminderOrder:00011231
  • Complete Reminders: reminderDoneTime:00011231 reminderOrder:00011231
<!-- Brand new reminder's attributes -->
<note-attributes>
  <reminder-order>20140501T210950Z</reminder-order>
  <reminder-time>20140502T160000Z</reminder-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>
<!-- 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>
<!-- 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>
<!-- 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>

##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