Drafts Action Directory

New Draft with Current Tags

Posted by @pdavisonreiber, Last updated: 2018-05-27 15:51:32 UTC

Creates a new draft with the same tags and syntax mode as the current draft. Keyboard shortcut is ⌘ shift N to complement ⌘ N for the built in new draft shortcut. Useful for creating new notes while working in a workspace.

Install

Steps

  • script

    // New Draft with Current Tags
    
    var newDraft = Draft.create()
    
    newDraft.languageGrammar = draft.languageGrammar
    
    for (tag of draft.tags) {
    	newDraft.addTag(tag)
    }
    		   
    newDraft.update()
    editor.load(newDraft)
Actions available in the Action Directory are uploaded by community members. Use appropriate caution reviewing downloaded actions before use.