I have a Google Sheet that I am using as a template. This sheet contains a script that uses an advanced service. However when I take a copy of the sheet the contained script no longer has permissions to access the advanced service in the dev console (it is "on" in "Advanced Google Service" list).
How can I ensure that the copy of the template sheet also has permission to access the advanced service without having to manually enable it in every copy?
I did find this way of enabling APIs in the dev console programatically from Spencer but I still get the same error about needing to enable the API in the dev console.
I can kind of get it to work by moving the Tasks API functionality into an add-on as it uses the add-ons console project. But that doesn't quite fit with what I'm trying to do.