How to create a lib for scripts

Hi,

I keep reusing certain functions in multiple script, the current approach that i do is copy paste the functions into multiple files

Wanted to check if there is a better way where I can write it in one file and reference that function.

There are a number of ways to approach reuse, the two main ones:

  1. Have a separate action with the script step, and include that action in others using the “Include Action” step.
  2. Save the script in a file in iCloud Drive/Drafts/Library/Scripts and load it in other scripts using the require(path) function (docs).
2 Likes

Perfect pt 2 was what I was looking for thanks :slight_smile: