JSONIfyDRAFT | Drafts Action Directory

Posted by corwinslack, Last update less than a minute ago

The logic is by @agiletortoise but extended by corwinslack who is responsible for mistakes.


This is a companion discussion topic for the original entry at https://actions.getdrafts.com/a/1WP

When you work with a Draft in Shortcuts you could want more information than just the draft text itself. I started with a crude solution using JSON strings with template tag elements. @agiletortoise saw it and improved it like a real programmer. I extended his proposal by

  1. Adding almost all the template tags
  2. Made sure that the entire date time string is passed for created and modified dates
  3. Converted the body tag to HTML and passing it as a separate tag mdbody
  4. I added the [[shortcut_result]] template tag so this can run as a step 2 where a Shortcut precedes and can pass the result of step 1 to step 3.

The motivation? The Markdown to Evernote action does not work for me. This allows me to send the title and the modification date and time. No need to parse the first line from the draft. The first step of the shortcut should be

get dictionary from input.

An alternative? Send an markdown email to your Evernote account. Read the Evernote docs for specifying notebooks and adding tags.