Action

Save to Files as...

Posted by @sylumer, Last update about 3 years ago - Unlisted

Export to files, prompting for file name.

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
Items available in the Drafts Directory are uploaded by community members. Use appropriate caution reviewing downloaded items before use.