Student Gradebook. Unable to complete script because of “Access denied: DriveApp”

前端 未结 3 1965
无人共我
无人共我 2021-01-15 18:30

My script takes 35 student names from the Sheet \'Studenti\'. Then finds the proper folder with their name (i.e. \'Smith Peter\'), removes old pdf document with old grades h

3条回答
  •  -上瘾入骨i
    2021-01-15 19:13

    After few experiments I found the roots of the problem but not the solution. The problem with "Access denied" was related to the fact, that I was not the owner of the file created by my script and only the owner of the file may trash or delete the file. Although I was author of the script and had edit rights to the file which was placed on my drive, it did not work. On the other hand I could delete/trash the file manually without problems (and it was misleading for me).

    Lesson learnt: If you allow someone else to use your script that creates a new file and also trashes the old one than you probably cannot complete your script next time sice you are not allowed (Access denied) to trash the file created by other user (although the file was created on your own drive !).

    Adjusted question: Does anybody know how to write the script to trash/delete the file of which I am not the owner ( but I have edit rights) and which was created by other user on my drive?

提交回复
热议问题