问题
I need a help. I am using Google App Scripts for creating Google Forms. How I can change form's color/palette?
I tried to find here https://developers.google.com/apps-script/reference/forms/, but nothing found.
回答1:
For the moment you can't, FormApp works with the first version of Forms, so for the moment no templates available programmatically.
Last news on the subject here
回答2:
Good to note that once you generate a form programmatically, you can then edit it just like a regular form. You get the link to the editable page from form.getEditUrl()
.
回答3:
I was facing the same issue here and found a workaround: create a "Template Form" with the proper theme you want, then you make a copy of it and do your coding to the new copied form.
The problem is, if you want to custom each form with a theme, it would need several template forms, and the code should be able to select the correct template. However, this is not my case. Here is a sample code:
var file = DriveApp.getFileById('your-template-form-id').makeCopy();
var form = FormApp.openById(file.getId());
Just make sure you remove the single question that is created within the template form if you're adding questions dinamically, else, add the questions you need.
来源:https://stackoverflow.com/questions/37302543/change-form-palette-via-google-scripts