Reputation: 11
I am writing a Google Workspace add-on where the script creates one Google Document for each line in a Google Sheet owned by the user. The Google Documents are saved in the root of the user's Google Drive. I want the script to be able to automatically move all the files to a folder chosen by the user (or to create the files directly in a specified folder). I don't want the script to access the other user's files.
This only works if I add the https://www.googleapis.com/auth/drive
scope, whereas https://www.googleapis.com/auth/drive.file
is enough to create the new files in the root folder.
Is there a way to do what I want without using https://www.googleapis.com/auth/drive
?
Upvotes: 1
Views: 46
Reputation: 50426
You may be able do this with google-picker using scope:
https://www.googleapis.com/auth/drive.file
See https://developers.google.com/apps-script/guides/dialogs#file-open_dialogs
Upvotes: 2