本文介绍了removeFolder不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不确定我的脚本出了什么问题.

I'm not sure what is wrong with my script.

var folderToDelete = DriveApp.getFoldersByName('folderName').next();
DriveApp.removeFolder(folderToDelete);

它没有显示错误,文件夹也没有被删除

It doesn't show errors and the folder is not removed

确定名称为"folderName"的文件夹存在

It's sure the folder with name 'folderName' exists

谢谢!

推荐答案

removeFolder只是从驱动器的根目录中删除文件夹.从文档:

removeFolder just removes the folder from the root of the drive. From the documentation:

您是否在寻找 setTrashed() ?

Are you looking for setTrashed()?

folderToDelete.setTrashed(true)

这篇关于removeFolder不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 16:41