programmatically edit script in Google Drive document -
i have google drive document writes values google drive spreadsheet using google apps scripts.
the script associated document looks lot this:
// must change value actual spreadsheet id robproject.spreadsheetid = "spreadsheetid"; function onopen() { // stuff; }
each time create spreadsheet , related documents, manually change value spreadsheetid
spreadsheet's id documents know spreadsheet should write values.
i programmatic way fill in correct value spreadsheetid
documents' scripts.
when search "edit scripts programmatically," tutorials creating google apps scripts, not editing scripts scripts. there way edit google apps scripts google apps script?
if understand correctly, working document , spreadsheet. document needs know id of spreadsheet.
there ways access google apps script code through api, standalone projects, not container-bound scripts (unfortunately).
you consider using naming convention document , spreadsheet use drive service document spreadsheet (driveapp.getfilesbyname()). or possibly organize them folder (driveapp.getfoldersbyname(), folder.getfiles()).
if wanted store spreadsheet id in project property, build ui in document let user open list of files in drive , pick associated spreadsheet , store id (scriptproperties.setproperty('spreadsheetid')).
Comments
Post a Comment