Action Group

Sync Reminders

Posted by asteingr, Last update about 6 years ago

The core of this action group is the One-Way Sync action (CMD + SHIFT + S). This will take the current draft and add all the bullet points (using * or -) to an Apple Reminders list (list will be created based upon the draft’s title). Removal of bullet points or changes to due dates will be reflected in the iOS Reminders app after running the sync action again.

For example, given the following drafts content

# Work Todos

- Call with Tim @tomorrow @important
- Send out **JF protocol**
- Finish Drafts actions @due(2018-12-31)

the script will create a reminders list called Work Todos and three reminders with the appropriate due dates and priorities. The script will strip Markdown code from the Reminders title, so feel free to use Markdown formatting or hyperlinks, those won’t appear in the reminders being created.

Whenever due dates or priorities are changed or a bullet point is removed from the draft, this will be reflected in the Reminders app after running the One-Way Sync Drafts action from this action group again (CMD + SHIFT + S). Bullet points that were removed will be marked as completed in the Reminders app and pending alarms will be removed.

Due Dates and Priorities

You can use special keywords for specifying the reminders due date:

# My Work Todos

- My reminder @due(2018-12-31)

Or a due date with time:

# My Work Todos

- My reminder @due(2018-12-31, 13:00)

or today:

# My Work Todos

- My reminder @today

or tomorrow:

# My Work Todos

- My reminder @tomorrow

To specify the reminder priority you can use the keywords: @important or @prio(0|1|5|9) (0 .. no priority, 1 .. highest priority)

This action group comes with keyboards action to insert the keywords just mentioned.

Restrictions

Note that this is a one-way sync, changes done in the Reminders app won’t be reflected in the draft. It’s targeted at the use-case of compiling a list of todos and creating reminders for it.

As the public Drafts API does not provide a unique ID per reminder, this script will try to find already existing reminders based on their title. This is done by taking the current line, removing all Markdown, removing all whitespaces, creating the lower-case version and matching that against the reminders already available. As you can imagine, this is a relatively weak link as text changes will create new reminders and can’t reuse existing ones.

Third Party Code

This script embeds the following two JS libraries:

https://github.com/stiang/remove-markdown/ (MIT License, details see script code)
https://github.com/datejs/Datejs (Apache License Version 2.0, details see script code)

License

MIT License

Copyright © 2018 Andre Steingress, @asteingr

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


Included Actions

  • One-Way Sync
  • Date Keywords
  • Due Date
  • Today
  • Tomorrow
  • Priority Keywords
  • Priority
  • Important
Items available in the Drafts Directory are uploaded by community members. Use appropriate caution reviewing downloaded items before use.