Drafts Action Directory

Script Library

Posted by @edgauthier, Last updated: 2018-06-22 21:10:23 UTC

Defines a function that can be used to wrap other functions and include “library” scripts before the supplied function.

Use an Include Action step to include this action first before your other action steps to use it.

Based on code provided by @draft8



  • script

    // Scripting - Library
    const usingLibs = f => {
        `(() => {
          ${Draft.query("", "all", ["script", "lib"])
            .map(d => d.content)
          return (${f})();


Actions available in the Action Directory are uploaded by community members. Use appropriate caution reviewing downloaded actions before use.