Drafts Action Directory

Select Module

Posted by @nahumck, Last updated: 2018-06-22 21:12:01 UTC - Unlisted

Using select boxes, load a specified module.

Install

Steps

  • script

    // Module Select - using select boxes
    
    /* ------ Prompt ------- */
    var modules = [
    "General", 
    "GTD", 
    "Journal", 
    "Reading", 
    "Scripting", 
    "Work", 
    "Writing",
    ];
    
    var p = Prompt.create();
    p.title = "Select Module to Load";
    p.addSelect("module", "Module", modules, [""], false);
    p.addButton("Load");
    var con = p.show();
    
    var sel = p.fieldValues["module"];
    var module = sel+" Module";
    
    if (con) {
      // find action
      var action = Action.find(module);
      app.queueAction(action, draft)
    }
    else {
      context.cancel();
    }
Actions available in the Action Directory are uploaded by community members. Use appropriate caution reviewing downloaded actions before use.