Action

Send to Obsidian Vault

Posted by agiletortoise, Last update over 3 years ago

Add the current draft to an Obsidian vault as a new file, using the first line of the draft as the file name. The file will be stored in the default location for new files based on Obsidian settings.

By default, this action will send to a vault named “MY-VAULT-NAME”. To change the vault used, edit the template of the first “Define Template Tag” step in the action to be the name of a valid vault in your Obsidian installation.

To target different vaults, duplicate the action and change the vault name in the first action step.

This example utilizes Obsidian’s URL scheme support. More details on available options in their documentation.

Note that Drafts can also write to files using files action, if you wish to implement actions which write directly to a file in a folder used as an Obsidian vault.

For more details and ideas, read our Obsidian Integration Guide

Steps

  • defineTemplateTag

    name
    vaultName
    template
    MY-VAULT-NAME
  • defineTemplateTag

    name
    fileName
    template
    [[safe_title]]
  • defineTemplateTag

    name
    content
    template
    [[draft]]
    
    [[hashtags]]
    
  • url

    template
    obsidian://new?vault=[[vaultName]]&name=[[fileName]]&content=[[content]]
    useSafari
    false
    encodeTags
    true

Options

  • After Success Default
    Notification Info
    Log Level Info
Items available in the Drafts Directory are uploaded by community members. Use appropriate caution reviewing downloaded items before use.