Action

Extract Selection to Draft

Posted by nickcharlton, Last update 14 days ago - Unlisted

Given a selection, creates a new Draft with the selected text and maintains the current set of tags.

Steps

  • script

    (() => {
      const main = () => {
        const text = editor.getSelectedText();
    
        let newDraft = Draft.create();
        newDraft.content = text;
        draft.tags.forEach((tag) => newDraft.addTag(tag));
        newDraft.update();
      };
    
      main();
    })();

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.