Action

delete completed tasks (.md lists)

Posted by tantramar, Last update about 1 year ago - Unlisted

Clears any completed markdown tasks (i.e. lines with a prefix of ‘- [x]’) in the current draft.

Steps

  • script

    var text = editor.getText();
    var lines = text.split("\n");
    var c = "- [x]";
    var i = lines.length;
    
    while (i--) {
    	if (lines[i].includes(c)) {
    		lines.splice(i, 1);
    	}
    }
    
    editor.setText(lines.join('\n'));
    editor.save();

Options

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