François Talbot
François Talbot

Reputation: 11

Minimal Google Drive scope to select folder and move files there

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

Answers (1)

TheMaster
TheMaster

Reputation: 50426

You may be able do this with using scope:

https://www.googleapis.com/auth/drive.file

See https://developers.google.com/apps-script/guides/dialogs#file-open_dialogs

Upvotes: 2

Related Questions