Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我从编辑器中运行我的脚本时,它只执行一次并且一切正常,但是如果我从网页或 excel 插件或任何其他地方调用它,它有时会运行多次,直到达到 5 分钟的限制谷歌强加。有没有办法在第一次运行后停止脚本或检查它是否已经在运行。
感谢您的帮助。
这似乎有效:
var start = parseInt(UserProperties.getProperty('count'),10); if (start == 0) { UserProperties.setProperty('count', 1) //do stuff UserProperties.setProperty('count', 0) } else if (start>0) { Logger.log("Script is still runnning"); }