I'm looking for a way programmatically using NodeJS and google api to associate an existing apps script file(id) with a newly created spreadsheet/s or else to retrieve the associated script id from a newly created spreadsheet so I can inject a custom script code
so far I tried with google sheet api to retrieve the associated scrip id without any success, and I didn't find any documentation on how to associate a spreadsheet with an existing script id.
About your following question,
I'm looking for a way programmatically using NodeJS and google api to associate an existing apps script file(id) with a newly created spreadsheet/s or else to retrieve the associated script id from a newly created spreadsheet so I can inject a custom script code
if my understanding is correct, how about the following answer?
First, the prerequisite is as follows.
In the current stage, the existing Google Apps Script project cannot be directly linked as the container-bound script while keeping the script ID (file ID) of Google Apps Script. However, I thought that your goal could be achieved by creating a new Google Apps Script project to the existing Google Spreadsheet. In order to achieve this, how about the following flow?
By this flow, the new Google Spreadsheet including a container-bound script of your current Google Apps Script is created. I guessed that this might be your expected result.