- Obsidian Website
- URL Scheme:
obsidian://
- URL Scheme Documentation
Disclaimer: We are not Obsidian experts! This guide is meant to get people started with the basics of using Drafts with Obsidian. Feel free to expand on these ideas, or let us know if we’ve missed something important.
Obsidian is a popular personal knowledge management application that focuses on organizing and cross-linking Markdown files.
Drafts works nicely as a capture front-end for Obsidian. This article covers methods available to send items you have captured in Drafts to your Obsidian vaults. The actions provide here are all cross-platform and will work on both iOS and Mac.
Not all ways to work with Obsidian are covered here, just some basics to get you started.
URL-Based Actions
Obsidian’s URL scheme support allows Drafts to create new files in Obsidian, passing details to control which vault, file name, and content to include.
Below are example actions with variations of what is possible with URLs, see “Modifying URL Action Examples” below for details on adapting these to your needs:
- Send to Obsidian
- This action creates a new file with the content of the current draft in the active Obsidian vault, using the first line of the draft as a file name. It also appends any tags assigned in Drafts as #hashtags at the end of the file. The file will be stored in the default location for new files, as specified in Obsidian settings.
- Send to Obsidian Vault
- A modified version of the above action, this action also specifies which vault to use. If you have multiple Obsidian vaults, you might create multiple duplicates of this action, specifying a different target vault in each. See the “Modifying…” section below for details on changing the vault name.
For advanced use cases, see the Obsidian URL documentation for details on available parameters. It is possible to use different parameter combinations to target specific paths, etc.
Modifying URL Action Examples
Each of the example actions above defines the parameters used to construct the Obsidian URL in a series of “Define Template Tag” action steps. To modify these parameters, you can edit the templates of each of these steps.
For the “Send to Obsidian Vault” example to be useful, you will have to edit the action and change the template value “MY-VAULT” in the first step of the action to match the name of a vault in your Obsidian installation.
URL Pros & Cons
- PROS:
- Not important where you store your vaults.
- Works with encrypted vaults.
- After completion, you are left in Obsidian editing the newly created file, if you need to make any additional tweaks.
- CONS:
- Obsidian app must opened to complete the action.
- Obsidian does not support callback URLs, so this method cannot return results to Drafts, or be combined with other action steps as effectively.
- Cannot update existing files, only create new ones.
File-Based Actions
Obsidian vaults are a set of text files in a folder. Drafts can read-write-update files. Therefore, as long as your Obsidian vault is stored in a location accessible to Drafts actions, Drafts can also add to files in your vault directly, without the need to launch Obsidian.
Both of the below example actions rely on Folder Bookmarks, a new feature introduced in Draft v28. Make sure you are up-to-date before using these actions.
Below are file action examples:
- Save to Obsidian Vault
- Save current draft to the root folder associated with the bookmark named “Obsidian Vault”, using the first line as the file name.
- Append to Obsidian Journal
- Appends text of current draft to daily journal file named like
Daily-YYYY-MM-DD
in the folderJournal
. If the file does not exist, it will be created.
- Appends text of current draft to daily journal file named like
About Bookmarks
Both of these examples rely on Folder Bookmarks. The first time you run each of these examples on a device, you will be prompted to select your Obsidian Vault folder to grant Drafts permission to create files in that folder. More details on how bookmarks operate in the docs, but your vault must reside in a location which can be accessed by bookmarks. On Mac, this is any folder you have permissions to modify, but it is more limited on iOS, as many file provider apps (like Dropbox, Google Drive) do not support bookmarking. The most reliable place to store a vault to be able to use file-based actions on iOS is in your iCloud Drive folder.
Modifying File Actions
Each of the above examples uses a single File action step. File action steps have extensive options for configuring the path, file name, and content of the file. See docs for details on configuring these options.
File Pros & Cons
- PROS:
- No need to launch Obsidian to add content to a vault.
- Actions can also append-prepend-update files, not just create new ones.
- CONS:
- Vault must be store in a location accessible to Drafts.