I have a small script to delete trash emails every minute, that runs perfectly. The account with which I have created the script works perfect when it comes to empty the trash. The trash disappears every minute. But afterwards I made a web app and used it on another account. The script only cleared the trash when the user clicked on the link. It's not emptying trash every minute.
I have tried creating triggers Programatically like this:
function createTimeTriggerEveryNMinutes() {
ScriptApp.newTrigger("runScript")
.timeBased()
.everyMinutes(1)
.create();
}
but they are not working. Is there anyway I can run the script on another account. Please let me know. Thank you in advance.