I need to programmatically create a file based on a template Google Docs, and then process the document with a bound Script.
My initial approach was to create a bound script to the template file; then, using the google client library (for php, ruby, or w/e), copying the template into the actual document, and finally call the Script function on the newly copied document.
The problem is it seems you have to "publish" your bound App Script, and even after copying a document with a published bound script, the resulting file's script is not published.
Is there any way to copy the document and publish it's bound script directly from my PHP/Ruby/etc app?
PS: The reason I'm using bound script rather than just a script, it's because I need to store data using the PropertiesService.getDocumentProperties()
in order to replace some variables with a "preview" function