Drafts Action Directory

Double space

Posted by dchar, Last update 4 months ago - Unlisted

Double space a draft or a selection.

Install

Steps

  • script

    function deblank(s) {
        return s.split('\n').filter(l => l.trim());
      }
      
    function doublespace(s) {
        var arr = []
        for (let i of deblank(s)) {
            arr.push(i);
            arr.push('');
        }
        return arr.join('\n');
    }
    
    var sel = editor.getSelectedText();
    if (sel.length) {
      editor.setSelectedText( doublespace(sel) );
    } else {
      draft.content = doublespace( draft.content );
      draft.update();
    }
      

Options

  • After Success Nothing
    Notification Info
    Log Level Info
Actions available in the Action Directory are uploaded by community members. Use appropriate caution reviewing downloaded actions before use.