完全な解決策は次のとおりです。
1) ドライブに空のスクリプトを作成します
2) 次のコードを貼り付けます。
function doGet() {
try{
authorize();
var key = "YOUR DEVELOPER KEY";
var params = {method:"DELETE",
oAuthServiceName: "drive",
oAuthUseToken: "always"
};
UrlFetchApp.fetch("https://www.googleapis.com/drive/v2/files/trash?key="+key, params);
}
catch(error)
{
MailApp.sendEmail("<some email>", "EMPTY TRASH BIN ERROR:<br>"+error);
return;
}
}
function authorize() {
var oauthConfig = UrlFetchApp.addOAuthService("drive");
var scope = "https://www.googleapis.com/auth/drive";
oauthConfig.setConsumerKey("anonymous");
oauthConfig.setConsumerSecret("anonymous");
oauthConfig.setRequestTokenUrl("https://www.google.com/accounts/OAuthGetRequestToken? scope="+scope);
oauthConfig.setAuthorizationUrl("https://accounts.google.com/OAuthAuthorizeToken");
oauthConfig.setAccessTokenUrl("https://www.google.com/accounts/OAuthGetAccessToken");
}
3) スクリプトを Web アプリケーションとしてデプロイする
4) トップバーの時計をクリックし、doGet メソッドを呼び出すトリガーを作成します。
これにより、トリガーを作成しているユーザーのゴミ箱が空になります。