This repository is used to host the .gs files used in the Web Archiving QA process. These files are managed locally using node-google-apps-script
These scripts are part of the QA workflow. In order to be able to manage the writing and versioning of the script outside of Google Drive they are managed using node-google-apps-script. The individual files are referenced inside of separate Google Sheets that are used to hold the information submitted via Google Forms.
Within the Google Sheet that is collecting form responses for each collection for each collection the script editor imports these external files as a library, and the script from within the Google Sheet scripts editor that is collecting responses then references these external scripts. While this workflow is less straight forward than managing these scripts from directly within Google Sheets it allows for version control and greater flexibility in implementation.
-
Create a new project by visiting script.google.com
-
Click on File>Project Properties and copy the Project Key into your clipboard
-
In your terminal cd to the directory you would like the project to live in locally and then run gapps init
-
Write your code locally and test
-
Push your code to the Google Drive .gscript file using the command gapps upload
-
Open the .gscript file and click on File>manage all versions
-
Create a version and name it
-
Open the spreadsheet containing the responses from your Google Forms
-
Click on Tools>Script Editor
-
Click on Resources>Libraries
-
Paste the project key (found under File>Project Properties) in the .gscript file into the search field
-
Select from the dropdown the version you created in step 7
-
Within your Function in the editor use the identifier to call the script. For example if the identifier is NCStateCollection, you call the script in the following way:
function formSubmitReply(e) { NCStateCollection.formSubmitReply(e) }
-
Edits to the scripts are done locally and pushed back to Google Drive using the gapps upload command to upload the changes
-
After upload completes open the script from within Google Drive
-
Click on File>Manage All versions
-
Create a new version and give it a name
-
Open the Google Sheet that uses the script and click on Tools>Script Editor
-
Click on Resources>Libraries
-
From the dropdown menu select the latest version number and click ok