Publishing an Action that uses require()

Hi-

I have written a few scripts that all share a common set of functions and I use require() like this in each script.

require(“ai-common.js”);

I was wondering what I need to do in order to share these in the drafts directory?

You could include a link in the instructions on downloading and installing that file from elsewhere. You could write an action to install it. You could have a step that checks for it and installs it Iit is not present.

If you take a look at my Thoughtasylum libraries then ypu’ll see something even more sophisticated as all of the action groups utilise my TADpoLe library.

Thanks, Sylumer. I’m working on something similar and the idea to check and install the file if it’s missing makes sense. I’ll try that. Thanks for the tip about your library too.

I was hoping for something simple, instead I have just written a batch script that replaces all my “require” statements with the content of the js file.

Thx.

Okay, could the actions be bundled into an action group?

Could that action group contain an action that contains the JavaScript, that is then included into the other actions - so you have one place to maintain it, which is presumably why you were require-ing the code in the first place?