Drafts Action Directory

Save to Files as...

Posted by agiletortoise, Last update 5 months ago

Export to files, prompting for file name.

Install

Steps

  • script

    // prompt for file name
    var title = draft.processTemplate("[[safe_title]]");
    
    var p = Prompt.create();
    p.title = "Save as...";
    p.addTextField("fileName", "Name", title + ".txt");
    p.addButton("Export");
    
    if (p.show()) {
       var fileName = p.fieldValues["fileName"];
       draft.setTemplateTag("file", fileName);
    }
    else {
      context.cancel();
    }
  • export

    fileNameTemplate
    [[file]]
    template
    [[draft]]

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.