Search code examples
google-apps-scriptgoogle-apps-script-api

Creating a Google App Script programmatically with the API


Is it possible to create a brand new google app script programmatically and attach him to a specific google doc?

Or in any other way, to make 1 bound script and make several google docs to share him as the same bound script?


Solution

  • Yes. Possible through the API.

    Use project.create. You can provide a project title. You can also create a bound script by providing the Google Drive ID of a Google Doc, Sheet, Form, or Slides file to act as the script's parent.

    clasp is an open-source tool, separate from the Apps Script platform, that lets you develop and manage Apps Script projects from your terminal rather than the Apps Script editor.