1

I have a script running on a spreadsheet and was hoping to be able to push updates to that script with my continuous integration server. Is there currently an API for updating scripts programmatically?

3 Answers 3

4

No you cant update scripts inside spreadsheets. However if you make it a standalone script, you can update it with drive api (google it). If the script must for some reason be contained in the spreadsheet, then make that script a simple wrapper to the real script in a standalone library. Include the lib in 'development mode' and the spreadsheet will always use the latest library code.

Sign up to request clarification or add additional context in comments.

2 Comments

""Only the owner of the script can access this" AND any editor who has edit rights on the script too. This was not the case some time ago (I don't remember when it changed) but is the case now for sure." stackoverflow.com/questions/18543000/…
Here is a full startup project to fully automate Apps Script building and publishing using Travis CI: github.com/faresd/google-apps-script_travis-ci
1

The new Google add-ons for Google Sheets & Docs allow you to automatically update your scripts (add-ons, as they are now called).

2 Comments

Is it possible to distribute these add-ons without using the add-on store? This script isn't meant for public use necessarily.
not sure how this would help if what you want is to change its code programatically. With add-ons you stil need to manually modify the code and manually re-publish the add-on. Yes, the user gets the new code automatically but I believe thats not what he wants to accomplish.
0

From the question

Is there currently an API for updating scripts programmatically?

Yes, there is -> Google Apps Script API.

It worth to mention there is an open-source project managed by Google based on the API to use a terminal -> CLASP.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.