The appsscript.json manifest file in the
library is where the required scopes should be listed.
I don't believe that you need to edit every manifest file in all the Apps Script projects (script files) that the library is added to.
So, you shouldn't need to go into every project that the library is added to as far as the scopes are concerned.
However, every project that the library is added to has a setting for the library and the library version number in it's manifest file.
Adding a library and a version number to a manifest file is something that can be automated through the Apps Script API.
You need to know the Apps Script project (file) ID in order to get access to the particular manifest file in that Apps Script project.
As long as you can get the file ID's of all the projects that you need to change the manifest file in,
then you can write code to change the library version number and the runtime setting.
So, if you want to programmatically change a manifest file
FROM:
"runtimeVersion": "DEPRECATED_ES5"
TO:
"runtimeVersion": "V8"
That can be done with the Apps Script API.
It needs to be done with the "Update Content" method
I do have some sample code on GitHub, but it's not exactly what you need.
You can look at it, to see if it gives you any information.
You need to
- get all the Apps Script file ID's,
- loop through the file IDs,
- get the file content,
- modify the manifest file,
- update the new file content back to the same file.
So, in your case the source and target file are the same file.
In order to write the code that would do that, it would be work.
Actually, it would be a good add-on idea, to provide something that would loop through
a bunch of files and update all the manifest files.
There is a question on StackOverflow about programmatically editing bound apps script files.
But the answer is not correct.
Updating manifest files is something that I could integrate into a Web App.
I am working on a Web App that does stuff with the Apps Script API, and also includes a code editor.
Also see: