Drafts Action Directory

Duplicate Draft

Posted by @anandman, Last update 16 days ago

Duplicates current draft, using current selection, if any

Install

Steps

  • script

    // See online documentation for examples
    // http://getdrafts.com/scripting
    
    const newDraft = Draft.create()
    if (draft.selectionLength == 0) {
      newDraft.content = draft.content
    } else {
      newDraft.content = editor.getSelectedText()
    }
    
    newDraft.update()
    
    editor.load(newDraft)
    editor.focus()

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.