Is there an easy way of making a call from one Google Apps script to a function in another?
I'm writing two scripts, one which should use functions from the other. I want the two to have different sharing permissions, however, so I don't want to put them in the same project.
I can't seem to find any "require Xxx.gs" type function in the documentation.
I found this: Call functions from another "class" / file
But I get "xxx function not found" errors if I try to call a function from a different file.
As Corey mentioned in the post you refer to you need to use libraries to do what you want. You can not use functions from another project in a project (but you can of course use any function from different script files inside a project)
Besides libraries, if you actually want to keep the projects separate you can publish a service url and use parameters to call it from the other script with urlFetch, as in myserviceurl?call=myfunction¶m1=x
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With