Drafts Actions to Move Content into Obsidian (in iCloud)

This took me a little while to figure out this morning… so thought I would share. I wanted to send from Mac Drafts to Obsidian vault…

Steps

  1. Since my Obsidian vault is in my iCloud folder, I first had to create a bookmark to the Obsidian vault. This is done through the Drafts preferences.
  2. Create a new Drafts action that uses the File Service
  3. Choose if you want to create, append, etc.
  4. Add filename information (be sure to change .txt to .md).
    • Note you can also add a path, so in one instance I wanted files named with the date, to go into a folder named with a year.
      • Name:[[date]].md
      • Path: [[date|%Y]]
    • If instead you want the first line of the file to be the filename use the following settings:
      • Name: [[title]].md
      • Template: [[body]]

Notes

There is an existing move to obsidian action which I have installed and used, but this one opens the save dialog. I am using this to append to my daily notes, or create a new file in an Obsidian folder I have titled “inbox”. The file is created and saved automatically using the steps above.

References

6 Likes

This is cool. Thank you for sharing.

I’ve been using the excellent Obsidian community-contributed plugin, Advanced Obsidian URI. With this plugin installed in Obsidian, I have created actions for Drafts, Typinator, and Pop-Clip, so far. Here’s an example of the Drafts action to add what I call a “log note” to my daily note. The action uses the Drafts CallbackURL action step:

obsidian://advanced-uri?vault=<enter-your-vault-name>&daily=true&heading=Log%20Notes&mode=append&data=%0A%23%23%23%20[[date|%A %B %e, %Y %I:%M %p]]:%20[[title]]%0A%0A[[body]]

This has a lot of URL-encoding in it, and a long format for date+time, all of which can be eliminated if you don’t need those bits.

I use the Drafts share extension + capture window to grab highlights from articles – appending highlights to a master draft for the article. When I’m satisfied with the draft, I ship it over to Obsidian with the action above.

The Advanced Obsidian URI plugin has many alterative ways to create content in Obsidian using the URI scheme, including creating new files, appending to an existing file, identified by a UUID that I insert in the YAML frontmatter of new notes, etc. It is worth studying the documentation and experimenting with the plugin.

2 Likes

Excellent!

Would you mind editing the title to say “Drafts” instead of “Draft”?

I almost ignored the thread.

Thanks!

1 Like