Action

Preview Selected Drafts for Printing

Posted by sylumer, Last update about 1 month ago - Unlisted

This will display a printable preview that puts page breaks after each draft when printed and red separator lines between drafts when displaying on the screen.

Steps

  • defineTemplateTag

    name
    STYLE
    template
  • script

    // Initialise
    let hp = HTMLPreview.create();
    let mmd = MultiMarkdown.create();
    mmd.format = "html";
    
    // Get selected drafts content and prefix with styling from template tag
    let strAllContent = draft.processTemplate("\n\n[[STYLE]]\n\n") + app.currentWindow.selectedDrafts.map(ad => ad.content).join('\n\n<div class="page-break"></div>\n\n');
    
    // Convert Markdown to HTML and preview
    hp.show(mmd.render(strAllContent));

Options

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