Drafts Action Directory

Duplicate Draft

Posted by @eichtyler, Last update 9 months ago

Create a new draft with the contents of the current draft, then select the contents of the new draft. Allows you to easily duplicate a draft or start from a blank slate.

Install

Steps

  • script

    // See online documentation for examples
    // http://drafts5-help.agiletortoise.com/
    
    const newDraft = Draft.create()
    newDraft.content = draft.content
    newDraft.update()
    
    editor.load(newDraft)
    editor.focus()
    editor.setSelectedRange(0, newDraft.content.length)
    

Options

  • After Success Default
    Notification Info
    Log Level Info

Comments

Actions available in the Action Directory are uploaded by community members. Use appropriate caution reviewing downloaded actions before use.