Drafts Action Directory

Move Done Items

Posted by @hinnerkhaardt, Last update about 1 month ago

Moves done Markdown items – looking like „- [x]“ – to the end of the draft.

Install

Steps

  • script

    var lines = draft.content.split(/\r?\n/),
    ll = lines.length,
    top = [],
    bottom = [];
    
    for (var i = 0; i < ll; i++) {
        if (lines[i].startsWith('- [x]')) {
        bottom.push(lines[i]);
        } else {
        top.push(lines[i]);
        }
    }
    
    draft.content = top.join('\n') + '\n' + bottom.join('\n');
    

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.