Action

Send to Obsidian Memos

Posted by XTY, Last update about 2 years ago

UPDATES

about 2 years ago

Update comments

show all updates...

about 2 years ago

Update comments

about 2 years ago

Add comments

Add the current draft to daily notes, as an entry of Memos

Steps

  • script

    // See online documentation for examples
    // https://docs.getdrafts.com/docs/actions/scripting
    
    // Change vault name to yours
    
    let vault = "220 Evergreen"
    
    let body = draft.content
    body = body.replace(/(?:\r\n|\r|\n)/g, '<br>')
    
    let date = new Date()
    let timestamp = date.toString('HH:mm')
    let content = "- "+timestamp+" "+body
    
    let encodedVault = encodeURIComponent(vault)
    let encodedContent = encodeURIComponent(content)
    
    // Change/delete heading as needed, to match your memo setting
    // Change mode to append/prepend as needed
    
    let encodedURI = "obsidian://advanced-uri?vault="+encodedVault+"&daily=true&data="+encodedContent+"&heading=Today&mode=append"
    
    app.openURL(encodedURI)
    

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.