Action

Duplicate Draft

Posted by @eichtyler, Last update almost 6 years 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.

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
Items available in the Drafts Directory are uploaded by community members. Use appropriate caution reviewing downloaded items before use.