How do I enable permissions to FormApp?

For future people who come across this post, I resolved my issue by manually adding the following to my Manifest file:

"oauthScopes": [
    "https://www.googleapis.com/auth/forms",
    "https://www.googleapis.com/auth/spreadsheets"
],

You can find your Manifest file by clicking on View > Show Manifest File - this will make a file called appscript.json appear in your sidebar.

Then click Run or the play button in the toolbar - which will force the app to review permissions and prompt you to authorize with your account.

Note: A good point that @tehhowch has pointed out below is that adding this manually to your manifest will disable auto-detection of scopes. My auto-detection doesn't seem to be working correctly anyway, so I've gone ahead with this manual solution - just a word of warning.


Put

FormApp.getActiveForm();

in the first line of your function you're calling and manually call that function from editor. It asks you for permissions before it realises you're calling it from the editor.