r/GoogleAppsScript • u/Old-Nose3769 • May 14 '25
Question Create a new GAS project from within Apps Script
I'm trying to create a simple GAS project that will essentially serve as a setup script for a more complex GAS project. As such, I want to be able to create a GAS project from my script. Is this possible? I've looked into Script.Projects.create, but it is undefined, and I don't see the ability to add the Scripts API from the Services dropdown
3
Upvotes
4
u/Fantastic-Goat9966 May 14 '25
You need to have a gcp project with the app script api enabled and linked to your creator script. You have to have https://www.googleapis.com/auth/script.projects in the oauthScopes in your application.json. You can get an idtoken and hit https://script.googleapis.com/v1/projects to create a new project.
1
u/Livid_Spray119 May 14 '25
Silly question, why do you need to create an (I guess) empty GAS project from another one?
Or do you want to make like.. a copy from the original file?
1
u/asinomasimple May 14 '25
Do you want to create a standalone script file (.gs) not tied to a Spreadsheet, for example? You can do that from the Drive interface.