Action

thoressen reformatter

Posted by @sylumer, Last update over 5 years ago - Unlisted

Steps

  • script

    //Build first line - time index & title
    let strFormattedContent = draft.processTemplate("[[created|%Y%m%d%H%M]]") + " " + draft.processTemplate("[[line|1]]") + "\n";
    //Build title line
    strFormattedContent += "title: " + draft.processTemplate("[[line|1]]") + "\n";
    //Build tags line
    strFormattedContent += "tags: #inbox #andperhapssomeothertag" + "\n";
    //Build source line
    strFormattedContent += "source: " + draft.processTemplate("[[line|2]]") + "\n";
    //Build time index line
    strFormattedContent += "timestamp: " + draft.processTemplate("[[created|%Y%m%d%H%M]]") + "\n";
    //Build separator line
    strFormattedContent += "- - -\n"
    //Append remaining quote and personal notes lines
    strFormattedContent += draft.processTemplate("[[line|4..]]");
    //Replace the original draft content with the new reformatted content
    draft.content = strFormattedContent;
    draft.update();

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.