Action
 Export Selected Drafts
Export Selected Drafts
                  
        Posted by sylumer,
    Last update
    over 2 years ago
    Export selected files to the file location defined by the Drafts folder bookmark “Export To”.
Steps
- 
    defineTemplateTagname fileextension template md 
- 
    scriptfunction exportDraft(p_fm, p_draft, p_strFileExtension) { let strFileName = p_draft.processTemplate("[[safe_title]].") + p_strFileExtension; p_fm.writeString(strFileName, p_draft.processTemplate("[[body]]")); app.displayInfoMessage("Exported " + strFileName); } let bmExport = Bookmark.findOrCreate("Export To"); let fmExport = FileManager.createForBookmark(bmExport); app.currentWindow.selectedDrafts.map(dExp => exportDraft(fmExport, dExp, draft.processTemplate("[[fileextension]]")));
Options
- 
  After Success Default Notification Error Log Level Error 
  Items available in the Drafts Directory are uploaded by community members. Use appropriate caution reviewing downloaded items before use.